---
title: "Packet 21: CreateEntity"
description: "Creates a map entity, light, deployable, pickup, or projectile. I and F are the integer- and fixed-property counts carried inside the record."
canonical: "https://aosplay.net/protocol-168/packets/21"
markdown: "https://aosplay.net/docs/protocol-168/packets/21.md"
last_updated: "2026-07-16"
protocol: "Ace of Spades Battle Builder 168"
packet_id_decimal: "21"
packet_id_hex: "0x15"
direction: "S→C"
family: "Entities"
implementation_status: "Sent"
evidence: "Live-verified"
wire_size: "34 + 4I + 2F bytes"
---

# Packet 21: CreateEntity

> Creates a map entity, light, deployable, pickup, or projectile. I and F are the integer- and fixed-property counts carried inside the record.

- **Decimal ID:** 21
- **Hex ID:** 0x15
- **Direction:** S→C
- **Family:** Entities
- **Status:** Sent
- **Evidence:** Live-verified
- **Wire size:** 34 + 4I + 2F bytes

## Implementation note

The standalone Entity structure and CreateEntity wrapper share ID 21. Retail has no legacy FLAG=0 or BASE=1 constructor; sending BASE can freeze scene creation.

## Exact wire layout

The application packet ID is the first byte. The remaining rows are in decode order. Byte sizes exclude ENet headers, wrapper prefixes, LZF chunk framing, and compression effects.

| # | Field | Encoding | Bytes | Purpose | Condition |
| ---: | --- | --- | ---: | --- | --- |
| 0 | `packet_id` | u8 | 1 | Always 21 (0x15). | — |
| 1 | `entity_id` | i16 LE | 2 | Scene-local entity identifier. | — |
| 2 | `entity_type` | u8 | 1 | entity type value. | — |
| 3 | `state` | u8 | 1 | Entity or gameplay state value. | — |
| 4 | `player_id` | i8 | 1 | Owning player, using the retail sentinel where applicable. | — |
| 5 | `position` | 3 × fixed16 LE | 6 | X, Y, and Z components at 1/64-unit precision. | — |
| 6 | `velocity` | 3 × fixed16 LE | 6 | X, Y, and Z components at 1/64-unit precision. | — |
| 7 | `yaw` | sign-magnitude fixed16 LE (1/64) | 2 | yaw value. | — |
| 8 | `color_r` | sign-magnitude fixed16 LE (1/64) | 2 | color r value. | — |
| 9 | `color_g` | sign-magnitude fixed16 LE (1/64) | 2 | color g value. | — |
| 10 | `color_b` | sign-magnitude fixed16 LE (1/64) | 2 | color b value. | — |
| 11 | `radius` | sign-magnitude fixed16 LE (1/64) | 2 | radius value. | — |
| 12 | `face` | u8 | 1 | Voxel face or placement orientation index. | — |
| 13 | `fuse` | sign-magnitude fixed16 LE (1/64) | 2 | fuse value. | — |
| 14 | `int_property_count` | u8 | 1 | I: number of 4-byte integer properties. | — |
| 15 | `float_property_count` | u8 | 1 | F: number of fixed16 properties. | — |
| 16 | `ugc_mode` | u8 | 1 | ugc mode value. | — |
| 17 | `int_properties[]` | I × i32 LE | 4I | Entity-type-specific integer properties. | — |
| 18 | `float_properties[]` | F × fixed16 LE | 2F | Entity-type-specific scalar properties. | — |

## Encoding conventions

- `LE` means least-significant byte first.
- `fixed16` is two-byte sign-magnitude at 1/64 precision.
- `orientation16` uses the measured 1/8192 orientation mapping.
- NUL strings consume their encoded byte length plus one `00` terminator.
- Counted arrays repeat immediately in the documented order.

## Related resources

- [HTML packet page](https://aosplay.net/protocol-168/packets/21)
- [Complete packet catalog](https://aosplay.net/protocol-168/packets)
- [Packet catalog in Markdown](https://aosplay.net/docs/protocol-168/packets.md)
- [Protocol 168 guide](https://aosplay.net/protocol-168)
