Chunk Format
Byte Order
The chunk format is stored in Big Endian byte order.
NBT structure
- The root tag.
- Level: The level data in this chunk.
- xPos: The X chunk coordinate.
- zPos: The Z chunk coordinate.
- TerrainPopulated: 1 or 0 (true/false) - true if special features have generated in this chunk such as trees, flowers, dungeons, etc.
- LastUpdate: The tick when the chunk was last updated.
- Blocks: 32768 bytes of block IDs, 8 bits per block. Stored in YZX order (Y increments first)[1]
- Data: 16384 bytes of block data, 4 bits per block. Stored in YZX order (Y increments first)[2]
- BlockLight: 16384 bytes of block light data, 4 bits per block. Stored in YZX order (Y increments first)[2]
- SkyLight: 16384 bytes of sky light data, 4 bits per block. Stored in YZX order (Y increments first)[2]
- HeightMap: 256 bytes of height map information, 8 bits per XZ column. Used for speeding up sky light calculations. Stored in ZX order (Z increments first)[3]
- Entities: List of CompoundTags, one for each entity in the chunk.[4]
- An entity. See Entity Format for details.
- TileEntities: List of CompoundTags, one for each tile entity in the chunk.
- A tile entity. See Tile Entity Format for details.
- Level: The level data in this chunk.
Notes
- Index is calculated with
Y + (Z * ChunkHeight(128) + (X * ChunkHeight(128) * ChunkSize(16) ) )
- Index is calculated with
(X << 11) | (Z << 7) | Y
- Index is calculated with
(Z << 4 | X) & 255
- Entities in versions between
Infdev 20100327
andInfdev 20100414
don't spawn due to a bug, which causes the list to always be empty, without the use of external editors to hack in entities.