---
title: "Packet 30: BuildPrefabAction"
description: "Requests a bounded KV6 prefab expansion. The server validates selection, stock, world contact, reservations, orientation, and cell range."
canonical: "https://aosplay.net/protocol-168/packets/30"
markdown: "https://aosplay.net/docs/protocol-168/packets/30.md"
last_updated: "2026-07-16"
protocol: "Ace of Spades Battle Builder 168"
packet_id_decimal: "30"
packet_id_hex: "0x1E"
direction: "C→S"
family: "Building"
implementation_status: "Handled"
evidence: "Implementation-backed"
wire_size: "Variable: 28 + prefab-name bytes"
---

# Packet 30: BuildPrefabAction

> Requests a bounded KV6 prefab expansion. The server validates selection, stock, world contact, reservations, orientation, and cell range.

- **Decimal ID:** 30
- **Hex ID:** 0x1E
- **Direction:** C→S
- **Family:** Building
- **Status:** Handled
- **Evidence:** Implementation-backed
- **Wire size:** Variable: 28 + prefab-name bytes

## 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 30 (0x1E). | — |
| 1 | `loop_count` | i32 LE | 4 | Simulation-loop stamp used for ordering, prediction, or reconciliation. | — |
| 2 | `prefab_name` | NUL-terminated UTF-8 string | N + 1 | prefab name value. | — |
| 3 | `player_id` | u8 | 1 | Compact player-slot identifier. | — |
| 4 | `prefab_yaw` | u8 | 1 | prefab yaw value. | — |
| 5 | `prefab_pitch` | u8 | 1 | prefab pitch value. | — |
| 6 | `prefab_roll` | u8 | 1 | prefab roll value. | — |
| 7 | `from_block_index` | i32 LE | 4 | from block index value. | — |
| 8 | `to_block_index` | i32 LE | 4 | to block index value. | — |
| 9 | `position` | 3 × i16 LE | 6 | Raw signed-short anchor coordinates. | — |
| 10 | `color` | BGR888 | 3 | Three colour channels written blue, green, then red. | — |
| 11 | `add_to_user_blocks` | boolean u8 | 1 | add to user blocks value. | — |

## 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/30)
- [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)
