Java Edition Indev level format

The .mclevel map format is a new map format, created by Notch. It is based on the NBT format.

A basic example can be seen here, a more up-to-date one comes below.

The map format is in use since indev version 0.31.

Blocks
The block byte array is used to define the types of blocks that occupy a map. The number of bytes in the array may be calculated by multiplying the dimensions of the map. Y being the up direction rather than Z. For Hex values see Block IDs.

To access a specific block from either the block or data array from XYZ coordinates, use the following formula:

Index = x + (y * Height + z) * Width

Data
The Data byte array is used for lighting and extra block data. The first 4 bit contains the extra block data and the other 4 bits the lighting.

The following blocks use extra data:

Lighting


There are 15 levels of lighting for a block ranging from 0x0 to 0xF.

Farmland
0x0 is dry land, 0x1 and above is wet. The wetness value depends on how far the block is away from water.

Crops
Crops grow from 0x0 to 0x6.



Torches
Torches use the data to determine their state.

0x0 is the basic straight torch. 0x1 to 0x4 are the torch sticking into a nearby block.