---
title: "Packet 31: ErasePrefabAction"
description: "Requests a UGC prefab carve over a bounded block-index range, ultimately using the verified Damage (37) block-destroy path."
canonical: "https://aosplay.net/protocol-168/packets/31"
markdown: "https://aosplay.net/docs/protocol-168/packets/31.md"
last_updated: "2026-07-16"
protocol: "Ace of Spades Battle Builder 168"
packet_id_decimal: "31"
packet_id_hex: "0x1F"
direction: "C→S"
family: "Building"
implementation_status: "Handled"
evidence: "Provisional"
wire_size: "Variable: 17 + prefab-name bytes"
---

# Packet 31: ErasePrefabAction

> Requests a UGC prefab carve over a bounded block-index range, ultimately using the verified Damage (37) block-destroy path.

- **Decimal ID:** 31
- **Hex ID:** 0x1F
- **Direction:** C→S
- **Family:** Building
- **Status:** Handled
- **Evidence:** Provisional
- **Wire size:** Variable: 17 + prefab-name bytes

## Implementation note

The recovered wire shape has no rotation fields and still needs a clean live-client validation pass.

## 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 31 (0x1F). | — |
| 1 | `loop_count` | i32 LE | 4 | Simulation-loop stamp used for ordering, prediction, or reconciliation. | — |
| 2 | `player_id` | u8 | 1 | Compact player-slot identifier. | — |
| 3 | `prefab_name` | NUL-terminated UTF-8 string | N + 1 | prefab name value. | — |
| 4 | `from_block_index` | i16 LE | 2 | from block index value. | — |
| 5 | `to_block_index` | i16 LE | 2 | to block index value. | — |
| 6 | `position` | 3 × fixed16 LE | 6 | X, Y, and Z components at 1/64-unit precision. | — |

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