Bedrock Edition level format

Minecraft Pocket Edition uses a completely different format for its saved games. Not much is known about it. Pocket Edition uses a modified NBT format, which uses a little-endian byte order, for some files.

level.dat
The format of level.dat has been changed in 0.2.0; it is now a NBT formatted file, containing player information and inventory.

TBD

chunks.dat
This file is loosely based on the Region Files used by Minecraft PC. It contains up to 32x32 uncompressed chunks having Blocks, Data, SkyLight, and BlockLight arrays. It appears that Pocket Edition levels are not infinite and have a maximum size of 32x32 chunks or 512x512x128 blocks.

Its first 4096 bytes make up a location table that describes which chunks are present in the level and where they can be found inside chunks.dat. These bytes make up 1024 32-bit little-endian integers, called locations from here on.

Like in region files, the location's three most significant bytes tell which sector the chunk starts at, while its least significant byte tells how many sectors the chunk spans. A sector is 4096 bytes long. To extract the starting sector and sector count from the location, do something like

The location's position in the first 1024 entries tells the chunk's coordinates. To find the position for the location corresponding to a chunk position, use the familiar formula   (unverified). For example, chunk (8, 13)'s sector start and count are stored at the th, or 424th location in the location table.

Chunks are always 21 sectors long, because they store a 4 byte length field followed by four uncompressed arrays: Blocks (8 sectors), Data(4), SkyLight(4), BlockLight(4).

Unlike Region Files, the chunks.dat does not use its second sector to store modification times. The first chunk in the file is stored in this sector (starting from offset 0x1000).

player.dat
In versions of Minecraft Pocket Edition before 0.2.0, this file stored the player inventory information, which is now stored in level.dat.

entities.dat
This file is added in version 0.2.0 Alpha, and uses the modified NBT format. It appears to store entity information.

TBD