Skip to content

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.
      • 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]
      • TileEntities: List of CompoundTags, one for each tile entity in the chunk.

Notes

  1. Index is calculated with Y + (Z * ChunkHeight(128) + (X * ChunkHeight(128) * ChunkSize(16) ) )
  2. Index is calculated with (X << 11) | (Z << 7) | Y
  3. Index is calculated with (Z << 4 | X) & 255
  4. Entities in versions between Infdev 20100327 and Infdev 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.

Contributors

The avatar of contributor named as BJTMastermind BJTMastermind

Changelog