MCBE
OverviewPacketsLevelChunk
ID 0x3A · 58Server → ClientWorld

LevelChunk

Sends a full chunk column: serialized sub-chunks, biome palettes, border blocks and block entity NBT in one payload blob.

level-chunk.bin
struct LevelChunk {
  ChunkPos                                     Pos;
  DimensionType                                DimensionId;
  varuint32                                    SubChunksCount;
  optional byte + varint32                     ClientRequestSubChunkLimit;
  bool                                         CacheEnabled;
  varuint32 [] · SubChunkMetadata[]            CacheMetadata;
  string                                       SerializedChunk;
}

Structure

FieldTypeDescription
PosChunkPos
Dimension IdDimensionType
Sub Chunks Countvaruint32
Client Request Sub Chunk Limitoptional byte + varint32Presence flag on the wire; value omitted when absent.
Cache Enabledbool
Cache Metadatavaruint32 count + SubChunkMetadata[]Length-prefixed sequence.
Serialized Chunkstring

Structure of Serialized Chunk Payload

The uint32-length-prefixed chunk blob, as assembled by PowerNukkitX 3.0.5 for protocol 2193 (LevelDBProvider.requestChunkData).

FieldTypeDescription
Sub-chunk SectionsSub-chunk Section × SubChunksCountSections bottom→top starting at the dimension's minimum section Y; only up to the highest non-empty section.
Biome PalettesPaletted Storage × SubChunksCountOne 16³ biome storage per sent sub-chunk, in the same order. Heightmaps are not sent — the client derives them.
Border Blocksuint8 count + uint8[]Education-edition border block column Z-indexes, capped at 255. Vanilla servers write just the 0 count.
Block Entitiesnetwork NBT tagsLittle-endian network NBT compounds of spawnable block entities. An empty list is a single 0x00 byte (TAG_End).

Structure of Sub-chunk Section

Each serialized sub-chunk starts with its format version and layer count.

FieldTypeDescription
Versionuint8Sub-chunk format version — 9.
Layer Countuint8Block storage layers — 2 (second layer is waterlogging).
Yint8Sub-chunk Y index relative to the dimension's minimum section.
Block Layer 0Paletted StorageBlock states; palette entries are network block state hashes when StartGame set Block Network Ids Are Hashes.
Block Layer 1Paletted StorageLiquid layer (waterlogged blocks).

Structure of Paletted Storage (network)

Shared encoding for block and biome data: a bit-packed word array plus a palette of runtime values.

FieldTypeDescription
Headeruint8(bits << 1) | 1 for network format. bits ∈ {1,2,3,4,5,6,8,16}; 0 = uniform storage. A header of 0xFF means "same palette as the previous storage" and nothing else follows.
Wordsint32 (LE) × ⌈4096·bits/32⌉Bit-packed palette indices for the 16³ cells; absent for uniform storage.
Palette Sizevarint32Number of palette entries; omitted for uniform storage.
Palettevarint32 × sizeRuntime values — block state hashes (blocks) or biome ids (biomes).

Notes

  • The payload is a uint32-length-prefixed blob — the full layout is in the tables below.
  • The limited sub-chunk request system: when Sub Chunks Count is 0xFFFFFFFE/0xFFFFFFFF the client pulls missing sub-chunks via SubChunkRequest instead of receiving full columns.
  • Cache Enabled pairs with ClientCacheBlobStatus/ClientCacheMissResponse to dedupe unchanged chunks by blob hash.
  • Sub Chunks Count counts only up to the highest non-empty section; biome palettes are sent for exactly those sections.