Minecraft:Bedrock Edition level format: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{about|the | {{about|the current Bedrock Edition world save format|formats used in earlier versions|Bedrock Edition level format/History}} | ||
{{exclusive|bedrock}} | {{exclusive|bedrock}} | ||
{{ | {{Update}} | ||
''Bedrock Edition'' | ''Bedrock Edition'' stores world data in a modified version of Google's LevelDB with zlib compression support. World settings are stored separately in {{cd|level.dat}}. Each world has its own directory containing these files.<ref name="mojang-leveldb">[https://github.com/Mojang/leveldb Mojang: LevelDB implementation]</ref> | ||
== | == World files and locations == | ||
* {{cd|db/}} - the database containing terrain, entities, and other world data. | |||
* {{cd|level.dat}} - world settings in little-endian NBT, preceded by an eight-byte header. | |||
* {{cd|level.dat_old}} - a previous copy of the world settings, when present. | |||
* <code>level.dat_new</code> - a temporary copy of the world settings used while saving the level.dat file, will only be present while saving or if the game crashed while saving the level.dat. The game writes the data to level.dat_new, deletes level.dat_old. renames level.dat to level.dat_old, and renames level.dat_new to level.dat. | |||
* {{cd|levelname.txt}} - the world name. | |||
* {{cd|world_icon.jpeg}} - the world thumbnail, when present. | |||
World locations depend on the platform and installation. On Windows, [[Minecraft:Bedrock Edition 1.21.120|1.21.120]] migrated the game from [[Minecraft:wikipedia:Universal_Windows_Platform|UWP]] to [[Minecraft:wikipedia:Game_development_kit|GDK]] and moved its content under {{cd|%APPDATA%\Minecraft Bedrock}}. Earlier Windows installations used {{cd|%LOCALAPPDATA%\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang}}.<ref>[https://learn.microsoft.com/en-us/minecraft/creator/documents/gdkpcprojectfolder Microsoft Learn: GDK migration on Windows]</ref><ref>[https://feedback.minecraft.net/hc/en-us/articles/40566672351885-Minecraft-1-21-120-Bedrock Mojang: Bedrock Edition 1.21.120 changelog]</ref> See [[Minecraft:com.mojang]] for platform-specific locations. | |||
[[Minecraft:Bedrock Edition 26.40|26.40]] added Windows world cloud backup and synchronization.<ref name="release-2640">[https://www.minecraft.net/en-us/article/minecraft-bedrock-edition-26-40 Mojang: Bedrock Edition 26.40 changelog]</ref> | |||
== LevelDB format == | |||
The database is stored in the db/ | === Mojang variant === | ||
Mojang's [https://github.com/Mojang/leveldb LevelDB implementation] extends [https://github.com/google/leveldb Google's LevelDB] with zlib compression support. Database readers must support the compression types used by the world.<ref name="mojang-leveldb" /> A Java implementation is available as [https://github.com/HiveGamesOSS/leveldb-mcpe-java leveldb-mcpe-java]. | |||
The database is stored in the world's {{cd|db/}} directory. Pass this directory to the LevelDB API rather than an individual database file. LevelDB manages its table files, journals, and manifests together.<ref name="leveldb-files">[https://github.com/google/leveldb/blob/main/doc/impl.md Google: LevelDB implementation]</ref> | |||
=== Chunk key format === | === Chunk key format === | ||
A database key for data regarding a chunk is the concatenation of: | A database key for data regarding a chunk is the concatenation of: | ||
* Two signed 32-bit little-endian integers (x and z in chunk coordinates, respectively), | * Two signed 32-bit little-endian integers (x and z in chunk coordinates, respectively), | ||
* An optional third 32-bit little-endian integer (1 for the [[Minecraft:Nether]], 2 for the [[Minecraft:End]], omitted for the [[Minecraft:Overworld]]), | * An optional third 32-bit little-endian integer (1 for the [[Minecraft:Nether]], 2 for the [[Minecraft:End]], omitted for the [[Minecraft:Overworld]], except for "JigsawStructureBlueprint" records, where this third integer is always present), | ||
* A one-byte tag specifying the type of record represented by the key (see table), | * A one-byte tag specifying the type of record represented by the key (see table), | ||
* (for a "SubChunkPrefix" record) a one-byte subchunk index ( | * (for a "SubChunkPrefix" record) a signed one-byte subchunk Y index, and | ||
* (for a "JigsawStructureBlueprint" record) an eight-byte structure ID. | |||
Accordingly, such a key may be 9, 10, 13 or | Accordingly, such a key may be 9, 10, 13, 14, or 21 bytes long. Not all subchunks necessarily exist for a given chunk. The Y index is the block Y coordinate divided by 16, rounded down. Negative indices represent terrain below Y=0; readers must not assume every dimension has only 16 subchunks.<ref name="subchunk-code">[https://github.com/louis-e/arnis/blob/main/src/world_editor/bedrock.rs arnis: Bedrock world reader and writer]</ref> | ||
The "BlockEntity" | The "BlockEntity" and legacy "Entity" records are represented by a sequence of concatenated root tags in a variant of [[Minecraft:NBT]] which stores the lengths and the multi-byte integer types in little-endian format, as opposed to the big-endian format used by {{el|je}} or the original NBT specification. | ||
The | The {{cd|Version}} record identifies the chunk storage version. It is separate from the subchunk version, the {{cd|level.dat}} header version, and the network protocol version. | ||
{| class="wikitable" style="text-align:center" data-description="" | {| class="wikitable" style="text-align:center" data-description="" | ||
| Line 40: | Line 49: | ||
! <abbr title="Decimal">Dec</abbr> !! <abbr title="Hexadecimal">Hex</abbr> !! ASCII | ! <abbr title="Decimal">Dec</abbr> !! <abbr title="Hexadecimal">Hex</abbr> !! ASCII | ||
|- | |- | ||
|43||2B|| | |43||2B||{{cd|+}}||Data3D | ||
|Heightmap (256×2 bytes) | |Heightmap (256×2 bytes) | ||
Biome data (varying lengths) | Biome data (varying lengths) | ||
|Biomes are stored as palettes similar to blocks. | |Biomes are stored as palettes similar to blocks. The layout depends on the storage version and dimension. {{info needed|Document the dimension-specific palette count and reuse encoding.}} | ||
|- | |- | ||
|44||2C|| | |44||2C||{{cd|,}}||Version | ||
|1 byte||A byte | |1 byte||A byte | ||
|- | |- | ||
|45 ||2D || | |45 ||2D ||{{cd|-}}||Data2D | ||
|Heightmap (256×2 bytes) | |Heightmap (256×2 bytes) | ||
2D biomes (256×1 bytes or 256×2 bytes) | 2D biomes (256×1 bytes or 256×2 bytes) | ||
|Biome IDs are written as 8-bit integers (or 16-bit little-endian integers in v1. | |Biome IDs are written as 8-bit integers (or 16-bit little-endian integers in v1.21.40.23+). No longer written since v1.18.0, except for worlds using the [[Minecraft:Old]] world type or an older base game version (the {{cd|baseGameVersion}} level.dat property). | ||
|- | |- | ||
|46||2E|| | |46||2E||{{cd|.}}||Data2DLegacy | ||
|Heightmap (256×2 bytes) | |Heightmap (256×2 bytes) | ||
2D biomes (256×4 bytes) | 2D biomes (256×4 bytes) | ||
|Each entry of the biome array contains a biome ID in the first byte, and the final 3 bytes are red/green/blue respectively. No longer written since v1.0.0. | |Each entry of the biome array contains a biome ID in the first byte, and the final 3 bytes are red/green/blue respectively. No longer written since v1.0.0. | ||
|- | |- | ||
|47||2F|| | |47||2F||{{cd|/}}|| SubChunkPrefix | ||
|Subchunk version (1 byte) Version-dependent data||Terrain for a 16×16×16 subchunk | |Subchunk version (1 byte) Version-dependent data||Terrain for a 16×16×16 subchunk | ||
|- | |- | ||
|48||30|| | |48||30||{{cd|0}}||LegacyTerrain | ||
|Block IDs (32768 bytes) | |Block IDs (32768 bytes) | ||
Block meta (32768 nibbles) | Block meta (32768 nibbles) | ||
| Line 77: | Line 86: | ||
Biomes are IDs plus RGB colours similar to Data2DLegacy. | Biomes are IDs plus RGB colours similar to Data2DLegacy. | ||
|- | |- | ||
|49||31|| | |49||31||{{cd|1}}||BlockEntity | ||
|List of NBT compound roots||[[Minecraft:Block entity]] data (little-endian NBT) | |List of NBT compound roots||[[Minecraft:Block entity]] data (little-endian NBT) | ||
|- | |- | ||
| 50||32|| | | 50||32||{{cd|2}}||Entity | ||
|List of NBT compound roots||[[Minecraft: | |List of NBT compound roots||Legacy [[Minecraft:entity]] data (little-endian NBT). See [[#Entity storage|Entity storage]] for modern records. | ||
|- | |- | ||
| 51||33|| | | 51||33||{{cd|3}}||PendingTicks | ||
|NBT compound root||Pending tick data (little-endian NBT) | |NBT compound root||Pending tick data (little-endian NBT) | ||
|- | |- | ||
|52||34|| | |52||34||{{cd|4}}||LegacyBlockExtraData | ||
|Entry count (4 bytes) | |Entry count (4 bytes) | ||
Entries: Key (4 bytes), Value (2 bytes). | Entries: Key (4 bytes), Value (2 bytes). | ||
|Array of blocks that appear in the same place as other blocks. Used for grass appearing inside snow layers prior to v1.2.13. No longer written as of v1.2.13. | |Array of blocks that appear in the same place as other blocks. Used for grass appearing inside snow layers prior to v1.2.13. No longer written as of v1.2.13. | ||
|- | |- | ||
|53||35|| | |53||35||{{cd|5}}||BiomeState | ||
| || | | || | ||
|- | |- | ||
|54||36|| | |54||36||{{cd|6}}||FinalizedState | ||
|4 bytes||A 32-bit little endian integer | |4 bytes||A 32-bit little endian integer | ||
|- | |- | ||
|55||37 || | |55||37 ||{{cd|7}}||ConversionData | ||
| ||No longer used | | ||No longer used | ||
|- | |- | ||
|56||38|| | |56||38||{{cd|8}}|| BorderBlocks | ||
| ||Education Edition Feature | | ||Education Edition Feature | ||
|- | |- | ||
| 57||39|| | | 57||39||{{cd|9}}||HardcodedSpawners | ||
| ||Bounding boxes for structure spawns stored in binary format | | ||Bounding boxes for structure spawns stored in binary format | ||
|- | |- | ||
|58||3A|| | |58||3A||{{cd|:}}||RandomTicks | ||
|NBT compound root||Random tick data (little-endian NBT) | |NBT compound root||Random tick data (little-endian NBT) | ||
|- | |- | ||
|59||3B|| | |59||3B||{{cd|;}}||Checksums | ||
| ||xxHash checksums of other chunk records. No longer written as of v1.18.0. | | ||xxHash checksums of other chunk records. No longer written as of v1.18.0. | ||
|- | |- | ||
|61||3D|| | |61||3D||{{cd|=}}||MetaDataHash | ||
| | | | ||
| | | | ||
|- | |- | ||
| | |62||3E||{{cd|>}}||GeneratedPreCavesAndCliffsBlending | ||
| | | | ||
| Not used | | Not used | ||
|- | |- | ||
|63||3F|| | |63||3F||{{cd|?}}||BlendingBiomeHeight | ||
| | | | ||
| Not used | | Not used | ||
|- | |- | ||
|64||40|| | |64||40||{{cd|@}}||BlendingData | ||
| | | | ||
| | | | ||
|- | |- | ||
|65||41|| | |65||41||{{cd|A}}||ActorDigestVersion | ||
| | | | ||
| | | | ||
|- | |- | ||
|118||76|| | |118||76||{{cd|v}}||LegacyVersion | ||
|1 byte||Moved to 44 in v1.16.100 | |1 byte||Moved to 44 in v1.16.100 | ||
|- | |- | ||
|119 | |119 | ||
|77 | |77 | ||
| | |{{cd|w}} | ||
|AABBVolumes | |AABBVolumes | ||
| | |||
| | |||
|- | |||
|120 | |||
|78 | |||
|{{cd|x}} | |||
|JigsawStructureBlueprint | |||
| | | | ||
| | | | ||
|} | |} | ||
The tag assignments are version-dependent. Microsoft's published actor-storage documentation gives different assignments for tags {{cd|0x3D}}-{{cd|0x3F}} from the table above. These entries require verification against the world version being read.<ref name="actor-storage">[https://learn.microsoft.com/en-us/minecraft/creator/documents/actorstorage Microsoft Learn: Actor storage in Minecraft]</ref> | |||
=== Subchunk storage === | |||
A subchunk contains a 16×16×16 block volume. Paletted subchunks store block indices and a palette of block states. | |||
{| class="wikitable" | |||
! Version !! Header | |||
|- | |||
| 8 || Version byte and one-byte storage-layer count. | |||
|- | |||
| 9 || Version byte, storage-layer count, and signed one-byte subchunk Y index. | |||
|} | |||
Each layer starts with a byte whose upper seven bits specify the bits per palette index. Bit 0 distinguishes persistent palettes from runtime palettes. Disk block palettes use little-endian NBT rather than network runtime IDs. | |||
For nonzero bit widths, indices occupy little-endian 32-bit words. Each word holds {{cd|floor(32 / bits_per_index)}} indices; remaining bits are padding. The 4096 indices use XZY order, with Y changing fastest. The index words are followed by a four-byte little-endian palette count and the palette's NBT compounds.<ref name="subchunk-code" /> Multiple layers allow blocks and fluids to occupy the same position.<ref>[https://gist.github.com/Tomcc/a96af509e275b1af483b25c543cfbf37 Tommaso Checchi: Block changes in Beta 1.2.13]</ref> | |||
=== Entity storage === | |||
Modern worlds store entities individually under {{cd|actorprefix<ActorUniqueID>}} keys. An entity's ID remains stable between play sessions and is unique within its world. Separate {{cd|digp<Chunk Key>}} records hold the chunk's entity-key digest. Readers must handle these records rather than relying only on the legacy {{cd|Entity}} chunk record.<ref name="actor-storage" /> [[Minecraft:Block entity|Block entities]] use their separate chunk record. | |||
=== Other keys === | === Other keys === | ||
There's also the special key ~local_player for an entity data entry that holds the local player entity. The value associated with the ~local_player key is NBT encoded and has only a single compound tag at the root level. | There's also the special key ~local_player for an entity data entry that holds the local player entity. The value associated with the ~local_player key is NBT encoded and has only a single compound tag at the root level. | ||
Remote-player records use keys beginning with {{cd|player_}}. The suffix depends on the identity system and world version; the historical {{cd|clientid.txt}} convention does not describe every current world. Values contain a little-endian NBT root compound. | |||
There's also a special "game_flatworldlayers" key of length 20 for flat worlds. The value associated with this key is a set of numbers in ASCII text format. An example of a value associated with the "game_flatworldlayers" key is "[7,3,3,2]" where the value length for this example is 9. | There's also a special "game_flatworldlayers" key of length 20 for flat worlds. The value associated with this key is a set of numbers in ASCII text format. An example of a value associated with the "game_flatworldlayers" key is "[7,3,3,2]" where the value length for this example is 9. | ||
| Line 163: | Line 202: | ||
* actorprefix | * actorprefix | ||
* digp | * digp | ||
* legacy_console_player_ | |||
* map_ | * map_ | ||
* portals | * portals | ||
| Line 184: | Line 224: | ||
An official explanation from Microsoft about how entities (actors) are stored in LevelDB can be found on [https://learn.microsoft.com/en-us/minecraft/creator/documents/actorstorage?view=minecraft-bedrock-stable Microsoft Learn / Minecraft Bedrock Edition]. | An official explanation from Microsoft about how entities (actors) are stored in LevelDB can be found on [https://learn.microsoft.com/en-us/minecraft/creator/documents/actorstorage?view=minecraft-bedrock-stable Microsoft Learn / Minecraft Bedrock Edition]. | ||
=== | === Implementations === | ||
* An example implementation of a Bedrock level-db parser can be found in [https://github.com/mmccoo/minecraft_mmccoo/blob/master/parse_bedrock.cpp minecraft_mmccoo]. This implementation walks the NBTs of all block, entities/mobs, elevations, and village related items. | * An example implementation of a Bedrock level-db parser can be found in [https://github.com/mmccoo/minecraft_mmccoo/blob/master/parse_bedrock.cpp minecraft_mmccoo]. This implementation walks the NBTs of all block, entities/mobs, elevations, and village related items. | ||
* A TypeScript implementation can be found on the [https://www.npmjs.com/package/mcbe-leveldb mcbe-leveldb] NPM package. | * A more up-to-date TypeScript implementation can be found on the [https://www.npmjs.com/package/mcbe-leveldb mcbe-leveldb] NPM package. | ||
=== NBT structures === | === NBT structures === | ||
The following articles document NBT structures | The following articles document NBT structures used by world data. | ||
* [[Minecraft:Bedrock Edition level format/Entity format]] | * [[Minecraft:Bedrock Edition level format/Entity format]] | ||
| Line 198: | Line 239: | ||
== level.dat == | == level.dat == | ||
=== NBT | The {{cd|level.dat}} file contains uncompressed little-endian NBT with an eight-byte header. The first four bytes hold the file-format version as a little-endian integer; the next four hold the NBT payload length, excluding the header. Version 10 is used by modern saves. Readers should check the stored version rather than assuming it matches the game release. {{info needed|Verify the header version against current release saves.}} | ||
=== NBT structure === | |||
Tags depend on the game version, platform, and world settings. This list includes legacy and optional fields and is not a complete schema for every release. Preserve unrecognized fields when editing a world. | |||
In [[Minecraft:Bedrock Edition 26.30|26.30]], {{cd|locatorbar}} was replaced by {{cd|playerWaypoints}}. Existing true and false settings migrate to {{cd|everyone}} and {{cd|off}}, respectively. The exact NBT name, type, and stored enum values for the replacement still need documentation.<ref name="release-2630">[https://www.minecraft.net/en-us/article/minecraft-26-30-bedrock-changelog Mojang: Bedrock Edition 26.30 changelog]</ref> | |||
Since [[Minecraft:Bedrock Edition 26.40|26.40]], NBT lists and compounds have a nesting limit of 512.<ref name="release-2640" /> | |||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound}}: World data. | * {{nbt|compound}}: World data. | ||
| Line 209: | Line 257: | ||
*** {{nbt|byte|doorsandswitches}}: 1 or 0 (true/false) - true if the player is able to interact with redstone components. | *** {{nbt|byte|doorsandswitches}}: 1 or 0 (true/false) - true if the player is able to interact with redstone components. | ||
*** {{nbt|byte|flying}}: 1 or 0 (true/false) - true if the player is currently flying. | *** {{nbt|byte|flying}}: 1 or 0 (true/false) - true if the player is currently flying. | ||
*** {{nbt|float|flySpeed}}: The flying speed | *** {{nbt|float|flySpeed}}: The flying speed; the default is 0.05. | ||
*** {{nbt|byte|instabuild}}: 1 or 0 (true/false) - true if the player can instantly destroy blocks. | *** {{nbt|byte|instabuild}}: 1 or 0 (true/false) - true if the player can instantly destroy blocks. | ||
*** {{nbt|byte|invulnerable}}: 1 or 0 (true/false) - true if the player is immune to all damage and harmful effects. | *** {{nbt|byte|invulnerable}}: 1 or 0 (true/false) - true if the player is immune to all damage and harmful effects. | ||
| Line 220: | Line 268: | ||
*** {{nbt|byte|opencontainers}}: 1 or 0 (true/false) - true if the player is able to open containers. | *** {{nbt|byte|opencontainers}}: 1 or 0 (true/false) - true if the player is able to open containers. | ||
*** {{nbt|byte|teleport}}: 1 or 0 (true/false) - true if the player is allowed to teleport. | *** {{nbt|byte|teleport}}: 1 or 0 (true/false) - true if the player is allowed to teleport. | ||
*** {{nbt|float|verticalFlySpeed}}: The vertical flight speed | *** {{nbt|float|verticalFlySpeed}}: The vertical flight speed. {{info needed}} | ||
*** {{nbt|float|walkSpeed}}: The walking speed | *** {{nbt|float|walkSpeed}}: The walking speed; the default is 0.1. | ||
*** {{nbt|byte|worldbuilder}}: 1 or 0 (true/false) - true if the player is a world builder. (Removed 1.21.120 {{info needed}}) | *** {{nbt|byte|worldbuilder}}: 1 or 0 (true/false) - true if the player is a world builder. (Removed 1.21.120 {{info needed}}) | ||
** {{nbt|byte|allowdestructiveobjects}}: The | ** {{nbt|byte|allowdestructiveobjects}}: The {{cd|allowdestructiveobjects}} [[Minecraft:game rule]]. {{info needed}} | ||
** {{nbt|byte|allowmobs}}: The | ** {{nbt|byte|allowmobs}}: The {{cd|allowmobs}} [[Minecraft:game rule]]. {{info needed}} | ||
** {{nbt|string|baseGameVersion}}: The version of Minecraft that is the maximum version to load resources from. Eg. setting this to | ** {{nbt|string|baseGameVersion}}: The version of Minecraft that is the maximum version to load resources from. Eg. setting this to {{cd|1.16.0}} removes any features that were added after version {{cd|1.16.0}}. | ||
** {{nbt|string|BiomeOverride}}: Makes the world into a [[Minecraft:single biome]] world and the biome set here is the biome of this single biome world. | ** {{nbt|string|BiomeOverride}}: Makes the world into a [[Minecraft:single biome]] world and the biome set here is the biome of this single biome world. | ||
** {{nbt|byte|bonusChestEnabled}}: 1 or 0 (true/false) - true if the bonus chest is enabled. | ** {{nbt|byte|bonusChestEnabled}}: 1 or 0 (true/false) - true if the bonus chest is enabled. | ||
| Line 232: | Line 280: | ||
** {{nbt|byte|CenterMapsToOrigin}}: 1 or 0 (true/false) - true if the maps should be on a grid or centered to exactly where they are created. Default to 0. | ** {{nbt|byte|CenterMapsToOrigin}}: 1 or 0 (true/false) - true if the maps should be on a grid or centered to exactly where they are created. Default to 0. | ||
** {{nbt|byte|cheatsEnabled}}: 1 or 0 (true/false) - true if cheats are on. | ** {{nbt|byte|cheatsEnabled}}: 1 or 0 (true/false) - true if cheats are on. | ||
** {{nbt|byte|commandblockoutput}}: The | ** {{nbt|byte|commandblockoutput}}: The {{cd|commandblockoutput}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|commandblocksenabled}}: The | ** {{nbt|byte|commandblocksenabled}}: The {{cd|commandblocksenabled}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|commandsEnabled}}: {{info needed}} | ** {{nbt|byte|commandsEnabled}}: {{info needed}} | ||
** {{nbt|byte|ConfirmedPlatformLockedContent}}: 1 or 0 (true/false) - tells if the world has Platform-Specific texture packs or content. Used to prevent cross play in specific worlds, that use assets allowed only on specific consoles. | ** {{nbt|byte|ConfirmedPlatformLockedContent}}: 1 or 0 (true/false) - tells if the world has Platform-Specific texture packs or content. Used to prevent cross play in specific worlds, that use assets allowed only on specific consoles. | ||
| Line 240: | Line 288: | ||
** {{nbt|int|Difficulty}}: The current difficulty setting. 0 is Peaceful, 1 is Easy, 2 is Normal, and 3 is Hard. | ** {{nbt|int|Difficulty}}: The current difficulty setting. 0 is Peaceful, 1 is Easy, 2 is Normal, and 3 is Hard. | ||
** {{nbt|int|Dimension}}: The dimension the player is in. 0 is the Overworld, 1 is the Nether, and 2 is the End. {{info needed}} | ** {{nbt|int|Dimension}}: The dimension the player is in. 0 is the Overworld, 1 is the Nether, and 2 is the End. {{info needed}} | ||
** {{nbt|byte|dodaylightcycle}}: The | ** {{nbt|byte|dodaylightcycle}}: The {{cd|dodaylightcycle}} [[Minecraft:game rule]]. | ||
** {{nbt|byte| | ** {{nbt|byte|doentitydrops}}: The {{cd|doentitydrops}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|dofiretick}}: The | ** {{nbt|byte|dofiretick}}: The {{cd|dofiretick}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|doimmediaterespawn}}: The | ** {{nbt|byte|doimmediaterespawn}}: The {{cd|doimmediaterespawn}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|doinsomnia}}: The | ** {{nbt|byte|doinsomnia}}: The {{cd|doinsomnia}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|dolimitedcrafting}}: The | ** {{nbt|byte|dolimitedcrafting}}: The {{cd|dolimitedcrafting}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|domobloot}}: The | ** {{nbt|byte|domobloot}}: The {{cd|domobloot}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|domobspawning}}: The | ** {{nbt|byte|domobspawning}}: The {{cd|domobspawning}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|dotiledrops}}: The | ** {{nbt|byte|dotiledrops}}: The {{cd|dotiledrops}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|doweathercycle}}: The | ** {{nbt|byte|doweathercycle}}: The {{cd|doweathercycle}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|drowningdamage}}: The | ** {{nbt|byte|drowningdamage}}: The {{cd|drowningdamage}} [[Minecraft:game rule]]. | ||
** {{nbt|int|editorWorldType}}: The [[Minecraft:Editor]] world type. 0 is World, 1 is Project. | ** {{nbt|int|editorWorldType}}: The [[Minecraft:Editor]] world type. 0 is World, 1 is Project. | ||
** {{nbt|byte|educationFeaturesEnabled}}: Enables the | ** {{nbt|byte|educationFeaturesEnabled}}: Enables the {{cd|chemistry}} resource and behavior packs for the world, containing some features from ''[[Minecraft:Minecraft Education]]''. | ||
** {{nbt|string|EducationOid}}: A [[Minecraft:UUID]]. {{info needed}} | ** {{nbt|string|EducationOid}}: A [[Minecraft:UUID]]. {{info needed}} | ||
** {{nbt|string|EducationProductId}}: {{info needed}} | ** {{nbt|string|EducationProductId}}: {{info needed}} | ||
| Line 263: | Line 311: | ||
*** {{nbt|byte|saved_with_toggled_experiments}}: 1 or 0 (true/false) - true if the world has been saved with experiments on before. | *** {{nbt|byte|saved_with_toggled_experiments}}: 1 or 0 (true/false) - true if the world has been saved with experiments on before. | ||
*** ... Additional bytes for each experiment that Minecraft has/had. | *** ... Additional bytes for each experiment that Minecraft has/had. | ||
** {{nbt|byte|falldamage}}: The | ** {{nbt|byte|falldamage}}: The {{cd|falldamage}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|firedamage}}: The | ** {{nbt|byte|firedamage}}: The {{cd|firedamage}} [[Minecraft:game rule]]. | ||
** {{nbt|string|FlatWorldLayers}}: JSON that controls generation of flat worlds. The | ** {{nbt|string|FlatWorldLayers}}: JSON that controls generation of flat worlds. The {{cd|block_layers}} array must contain at least 2 valid blocks, otherwise the world will generate as void. Default is {{cd|{"biome_id":1,"block_layers":[{"block_name":"minecraft:bedrock","count":1},{"block_name":"minecraft:dirt","count":2},{"block_name":"minecraft:grass_block","count":1}],"encoding_version":6,"preset_id":"ClassicFlat","structure_options":null,"world_version":"version.post_1_18"}}}. | ||
** {{nbt|byte|globalmute}}: The | ** {{nbt|byte|globalmute}}: The {{cd|globalmute}} [[Minecraft:game rule]]. {{info needed}} | ||
** {{nbt|byte|ForceGameType}}: 1 or 0 (true/false) - true if force the player into the game mode defined in | ** {{nbt|byte|ForceGameType}}: 1 or 0 (true/false) - true if force the player into the game mode defined in {{cd|GameType}}. | ||
** {{nbt|byte|freezedamage}}: The | ** {{nbt|byte|freezedamage}}: The {{cd|freezedamage}} [[Minecraft:game rule]]. | ||
** {{nbt|int|functioncommandlimit}}: The | ** {{nbt|int|functioncommandlimit}}: The {{cd|functioncommandlimit}} [[Minecraft:game rule]]. | ||
** {{nbt|int|GameType}}: The default game mode of the player. 0 is [[Minecraft:Survival]], 1 is [[Minecraft:Creative]], 2 is [[Minecraft:Adventure]], 5 is [[Minecraft:Game mode#Default|Default]], and 6 is [[Minecraft:Spectator]]. | ** {{nbt|int|GameType}}: The default game mode of the player. 0 is [[Minecraft:Survival]], 1 is [[Minecraft:Creative]], 2 is [[Minecraft:Adventure]], 5 is [[Minecraft:Game mode#Default|Default]], and 6 is [[Minecraft:Spectator]]. | ||
** {{nbt|int|Generator}}: The world type. 0 is [[Minecraft:Old]], 1 is Infinite, 2 is [[Minecraft:Flat]], 5 is [[Minecraft:Void world|Void]], and others are Infinite with the bedrock layer at 0. | ** {{nbt|int|Generator}}: The world type. 0 is [[Minecraft:Old]], 1 is Infinite, 2 is [[Minecraft:Flat]], 5 is [[Minecraft:Void world|Void]], and others are Infinite with the bedrock layer at 0. | ||
** {{nbt|byte|hasBeenLoadedInCreative}}: Whether the world has [[Minecraft:achievements]] locked. Set to 1 if the default game mode is set to Creative, if [[Minecraft:Commands#Cheats|cheats]] have been enabled, or | ** {{nbt|byte|hasBeenLoadedInCreative}}: Whether the world has [[Minecraft:achievements]] locked. Set to 1 if the default game mode is set to Creative, if [[Minecraft:Commands#Cheats|cheats]] have been enabled, or when achievements have otherwise been disabled. Equipping a behavior pack does not universally disable achievements in current releases.<ref name="release-2630" /> | ||
** {{nbt|byte|hasLockedBehaviorPack}}: {{info needed}} | ** {{nbt|byte|hasLockedBehaviorPack}}: {{info needed}} | ||
** {{nbt|byte|hasLockedResourcePack}}: {{info needed}} | ** {{nbt|byte|hasLockedResourcePack}}: {{info needed}} | ||
| Line 286: | Line 334: | ||
** {{nbt|byte|IsSingleUseWorld}}: 1 or 0 (true/false) - (unused) may cause world to not save, or delete after use. Seems to default back to false when a world is loaded. | ** {{nbt|byte|IsSingleUseWorld}}: 1 or 0 (true/false) - (unused) may cause world to not save, or delete after use. Seems to default back to false when a world is loaded. | ||
** {{nbt|byte|isWorldTemplateOptionLocked}}: 1 or 0 (true/false) - true if the world options cannot be modified until the user accepts that they are changing the map. | ** {{nbt|byte|isWorldTemplateOptionLocked}}: 1 or 0 (true/false) - true if the world options cannot be modified until the user accepts that they are changing the map. | ||
** {{nbt|byte|keepinventory}}: The | ** {{nbt|byte|keepinventory}}: The {{cd|keepinventory}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|LANBroadcast}}: Whether the world has been opened with the "Visible to LAN players" world setting enabled. | ** {{nbt|byte|LANBroadcast}}: Whether the world has been opened with the "Visible to LAN players" world setting enabled. | ||
** {{nbt|byte|LANBroadcastIntent}}: Whether the "Visible to LAN players" world toggle is enabled. | ** {{nbt|byte|LANBroadcastIntent}}: Whether the "Visible to LAN players" world toggle is enabled. | ||
** {{nbt|list|lastOpenedWithVersion}}: Five {{nbt|int|int}}s representing the last version with which the world was opened. Eg. for the [[Minecraft:Bedrock Edition Preview 1.20.30.22|beta/''Preview'' 1.20.30.22]] the version is | ** {{nbt|list|lastOpenedWithVersion}}: Five {{nbt|int|int}}s representing the last version with which the world was opened. Eg. for the [[Minecraft:Bedrock Edition Preview 1.20.30.22|beta/''Preview'' 1.20.30.22]] the version is {{cd|1 20 30 22 1}}. | ||
** {{nbt|long|LastPlayed}}: Stores a timestamp of when the world was last played as the number of seconds since the epoch (1/1/1970). | ** {{nbt|long|LastPlayed}}: Stores a timestamp of when the world was last played as the number of seconds since the epoch (1/1/1970). | ||
** {{nbt|string|LevelName}}: Specifies the name of the world. | ** {{nbt|string|LevelName}}: Specifies the name of the world. | ||
| Line 299: | Line 347: | ||
** {{Nbt|int|LimitedWorldWidth}}: The width (in chunks) of the borders surrounding the (old) world generation. Defaults to 16. | ** {{Nbt|int|LimitedWorldWidth}}: The width (in chunks) of the borders surrounding the (old) world generation. Defaults to 16. | ||
** {{Nbt|int|LimitedWorldDepth}}: The depth (in chunks) of the borders surrounding the (old) world generation. Defaults to 16. | ** {{Nbt|int|LimitedWorldDepth}}: The depth (in chunks) of the borders surrounding the (old) world generation. Defaults to 16. | ||
** {{nbt|byte|locatorbar}}: The | ** {{nbt|byte|locatorbar}}: The legacy {{cd|locatorbar}} [[Minecraft:game rule]], replaced in [[Minecraft:Bedrock Edition 26.30|26.30]].<ref name="release-2630" /> | ||
** {{nbt|int|maxcommandchainlength}}: The | ** {{nbt|int|maxcommandchainlength}}: The {{cd|maxcommandchainlength}} [[Minecraft:game rule]]. | ||
** {{nbt|list|MinimumCompatibleClientVersion}}: Five {{nbt|int|int}}s representing the minimum compatible client version that is needed to open the world. Eg. for the [[Minecraft:Bedrock Edition Preview 1.20.30.22|beta/''Preview'' 1.20.30.22]] the minimum compatible version is | ** {{nbt|list|MinimumCompatibleClientVersion}}: Five {{nbt|int|int}}s representing the minimum compatible client version that is needed to open the world. Eg. for the [[Minecraft:Bedrock Edition Preview 1.20.30.22|beta/''Preview'' 1.20.30.22]] the minimum compatible version is {{cd|1 20 30 0 0}}. | ||
** {{nbt|byte|mobgriefing}}: The | ** {{nbt|byte|mobgriefing}}: The {{cd|mobgriefing}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|MultiplayerGame}}: Whether the world has been opened with the "Multiplayer Game" world setting enabled. | ** {{nbt|byte|MultiplayerGame}}: Whether the world has been opened with the "Multiplayer Game" world setting enabled. | ||
** {{nbt|byte|MultiplayerGameIntent}}: Whether the "Multiplayer Game" world toggle is enabled. | ** {{nbt|byte|MultiplayerGameIntent}}: Whether the "Multiplayer Game" world toggle is enabled. | ||
** {{nbt|byte|naturalregeneration}}: The | ** {{nbt|byte|naturalregeneration}}: The {{cd|naturalregeneration}} [[Minecraft:game rule]]. | ||
** {{nbt|int|NetherScale}}: | ** {{nbt|int|NetherScale}}: The horizontal coordinate scale between the Overworld and Nether. The default of 8 means one Nether block corresponds to eight Overworld blocks. | ||
** {{nbt|int|NetworkVersion}}: The protocol version of the version the world was last played on. | ** {{nbt|int|NetworkVersion}}: The [[Minecraft:protocol version]] of the version the world was last played on. | ||
** {{nbt|int|permissionsLevel}}: What permissions a player defaults to, when joining a world. | ** {{nbt|int|permissionsLevel}}: What permissions a player defaults to, when joining a world. | ||
** {{nbt|int|Platform}}: Seems to store the platform that the level is created on. Currently observed value is 2. | ** {{nbt|int|Platform}}: Seems to store the platform that the level is created on. Currently observed value is 2. | ||
| Line 313: | Line 361: | ||
** {{nbt|byte|PlayerHasDied}}: 1 or 0 (true/false) - true if a player has died.{{info needed}} | ** {{nbt|byte|PlayerHasDied}}: 1 or 0 (true/false) - true if a player has died.{{info needed}} | ||
** {{nbt|int|playerPermissionsLevel}}: What permissions a player has. | ** {{nbt|int|playerPermissionsLevel}}: What permissions a player has. | ||
** {{nbt|int|playersleepingpercentage}}: The | ** {{nbt|int|playersleepingpercentage}}: The {{cd|playersleepingpercentage}} [[Minecraft:game rule]], values above 100 mean that night will never turn into day. | ||
** {{nbt|string|prid}}: The UUID of the premium world template this world was created with. Used for [[Minecraft:Marketplace#Worlds|Marketplace worlds]].{{info needed}} | ** {{nbt|string|prid}}: The UUID of the premium world template this world was created with. Used for [[Minecraft:Marketplace#Worlds|Marketplace worlds]].{{info needed}} | ||
** {{nbt|byte|projectilescanbreakblocks}}: The | ** {{nbt|byte|projectilescanbreakblocks}}: The {{cd|projectilescanbreakblocks}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|pvp}}: The | ** {{nbt|byte|pvp}}: The {{cd|pvp}} [[Minecraft:game rule]]. | ||
** {{nbt|float|rainLevel}}: Related to the current strength of [[Minecraft:rain]].{{info needed}} | ** {{nbt|float|rainLevel}}: Related to the current strength of [[Minecraft:rain]].{{info needed}} | ||
** {{nbt|int|rainTime}}: Related to the [[Minecraft:weather cycle]] regarding rain.{{info needed}} | ** {{nbt|int|rainTime}}: Related to the [[Minecraft:weather cycle]] regarding rain.{{info needed}} | ||
** {{nbt|long|RandomSeed}}: Level seed. | ** {{nbt|long|RandomSeed}}: Level seed. | ||
** {{nbt|int|randomtickspeed}}: The | ** {{nbt|int|randomtickspeed}}: The {{cd|randomtickspeed}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|recipesunlock}}: The | ** {{nbt|byte|recipesunlock}}: The {{cd|recipesunlock}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|requiresCopiedPackRemovalCheck}}: {{info needed}} | ** {{nbt|byte|requiresCopiedPackRemovalCheck}}: {{info needed}} | ||
** {{nbt|byte|respawnblocksexplode}}: The | ** {{nbt|byte|respawnblocksexplode}}: The {{cd|respawnblocksexplode}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|sendcommandfeedback}}: The | ** {{nbt|byte|sendcommandfeedback}}: The {{cd|sendcommandfeedback}} [[Minecraft:game rule]]. | ||
** {{nbt|int|serverChunkTickRange}}: Simulation distance.{{info needed}} | ** {{nbt|int|serverChunkTickRange}}: Simulation distance.{{info needed}} | ||
** {{nbt|byte|showbordereffect}}: The | ** {{nbt|byte|showbordereffect}}: The {{cd|showbordereffect}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|showcoordinates}}: The | ** {{nbt|byte|showcoordinates}}: The {{cd|showcoordinates}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|showdaysplayed}}: The | ** {{nbt|byte|showdaysplayed}}: The {{cd|showdaysplayed}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|showdeathmessages}}: The | ** {{nbt|byte|showdeathmessages}}: The {{cd|showdeathmessages}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|showrecipemessages}}: The | ** {{nbt|byte|showrecipemessages}}: The {{cd|showrecipemessages}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|showtags}}: The | ** {{nbt|byte|showtags}}: The {{cd|showtags}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|spawnMobs}}: 1 or 0 (true/false) - true if mobs can spawn. | ** {{nbt|byte|spawnMobs}}: 1 or 0 (true/false) - true if mobs can spawn. | ||
** {{nbt|int|spawnradius}}: The | ** {{nbt|int|spawnradius}}: The {{cd|spawnradius}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|SpawnV1Villagers}}: Spawn pre-1.10.0 villagers. | ** {{nbt|byte|SpawnV1Villagers}}: Spawn pre-1.10.0 villagers. | ||
** {{nbt|int|SpawnX}}: The X coordinate of the player's spawn position. Defaults to 0. | ** {{nbt|int|SpawnX}}: The X coordinate of the player's spawn position. Defaults to 0. | ||
| Line 342: | Line 390: | ||
** {{nbt|byte|texturePacksRequired}}: 1 or 0 (true/false) - true if the user must download the texture packs applied to the world to join. | ** {{nbt|byte|texturePacksRequired}}: 1 or 0 (true/false) - true if the user must download the texture packs applied to the world to join. | ||
** {{nbt|long|Time}}: Stores the current "time of day" in ticks. There are 20 ticks per real-life second, and 24000 ticks per Minecraft [[Minecraft:daylight cycle]], making the full cycle length 20 minutes. 0 is the start of [[Minecraft:Daylight cycle#Daytime|daytime]], 12000 is the start of [[Minecraft:Daylight cycle#Sunset/dusk|sunset]], 13800 is the start of [[Minecraft:Daylight cycle#Nighttime|nighttime]], 22200 is the start of [[Minecraft:Daylight cycle#Sunrise/dawn|sunrise]], and 24000 is daytime again. The value stored in level.dat is always increasing and can be larger than 24000, but the "time of day" is always modulo 24000 of the "Time" field value. | ** {{nbt|long|Time}}: Stores the current "time of day" in ticks. There are 20 ticks per real-life second, and 24000 ticks per Minecraft [[Minecraft:daylight cycle]], making the full cycle length 20 minutes. 0 is the start of [[Minecraft:Daylight cycle#Daytime|daytime]], 12000 is the start of [[Minecraft:Daylight cycle#Sunset/dusk|sunset]], 13800 is the start of [[Minecraft:Daylight cycle#Nighttime|nighttime]], 22200 is the start of [[Minecraft:Daylight cycle#Sunrise/dawn|sunrise]], and 24000 is daytime again. The value stored in level.dat is always increasing and can be larger than 24000, but the "time of day" is always modulo 24000 of the "Time" field value. | ||
** {{nbt|byte|tntexplodes}}: The | ** {{nbt|byte|tntexplodes}}: The {{cd|tntexplodes}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|tntexplosiondropdecay}}: The | ** {{nbt|byte|tntexplosiondropdecay}}: The {{cd|tntexplosiondropdecay}} [[Minecraft:game rule]]. | ||
** {{nbt|byte|useMsaGamertagsOnly}}: Whether the world is restricted to Microsoft Accounts only (players must be signed in). | ** {{nbt|byte|useMsaGamertagsOnly}}: Whether the world is restricted to Microsoft Accounts only (players must be signed in). | ||
** {{nbt|compound|world_policies}}: {{info needed}} | ** {{nbt|compound|world_policies}}: {{info needed}} | ||
| Line 351: | Line 399: | ||
</div> | </div> | ||
== | == Database files and logs == | ||
< | LevelDB uses several files in {{cd|db/}}:<ref name="leveldb-files" /> | ||
* {{cd|CURRENT}} identifies the active manifest. | |||
* {{cd|MANIFEST-*}} files describe the database's table files and state. | |||
* {{cd|*.ldb}} files contain sorted key-value tables. | |||
* Numbered {{cd|*.log}} files are binary write-ahead journals used to recover recent writes. | |||
* {{cd|LOG}} and {{cd|LOG.old}} are human-readable diagnostic logs. | |||
* {{cd|LOCK}} coordinates access to the database. | |||
< | The diagnostic {{cd|LOG}} is separate from the binary journal format. A diagnostic entry can look like this: | ||
<pre>2014/07/24-22:20:08.400488 4a3638 Recovering log #3</pre> | |||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|pocket alpha}} | |{{HistoryLine|pocket alpha}} | ||
| Line 373: | Line 428: | ||
|{{HistoryLine|bedrock}} | |{{HistoryLine|bedrock}} | ||
|{{HistoryLine||1.2.13|dev=?|Subchunks are now palleted.<ref>https://gist.github.com/Tomcc/a96af509e275b1af483b25c543cfbf37#the-new-subchunk-format</ref>}} | |{{HistoryLine||1.2.13|dev=?|Subchunks are now palleted.<ref>https://gist.github.com/Tomcc/a96af509e275b1af483b25c543cfbf37#the-new-subchunk-format</ref>}} | ||
|{{HistoryLine||1.21.120|Windows storage moved from the UWP location to the GDK location.<ref>[https://learn.microsoft.com/en-us/minecraft/creator/documents/gdkpcprojectfolder Microsoft Learn: GDK migration on Windows]</ref>}} | |||
|{{HistoryLine||26.30|The locatorbar game rule was replaced by playerWaypoints, with existing values migrated when loading a world.<ref name="release-2630" />}} | |||
|{{HistoryLine||26.40|Added Windows world cloud backup and synchronization. | |||
|NBT lists and compounds now have a nesting limit of 512.<ref name="release-2640" />}} | |||
}} | }} | ||
Latest revision as of 11:04, 16 October 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template:Exclusive Template:Update
Bedrock Edition stores world data in a modified version of Google's LevelDB with zlib compression support. World settings are stored separately in Template:Cd. Each world has its own directory containing these files.<ref name="mojang-leveldb">Mojang: LevelDB implementation</ref>
World files and locations
- Template:Cd - the database containing terrain, entities, and other world data.
- Template:Cd - world settings in little-endian NBT, preceded by an eight-byte header.
- Template:Cd - a previous copy of the world settings, when present.
level.dat_new- a temporary copy of the world settings used while saving the level.dat file, will only be present while saving or if the game crashed while saving the level.dat. The game writes the data to level.dat_new, deletes level.dat_old. renames level.dat to level.dat_old, and renames level.dat_new to level.dat.- Template:Cd - the world name.
- Template:Cd - the world thumbnail, when present.
World locations depend on the platform and installation. On Windows, 1.21.120 migrated the game from UWP to GDK and moved its content under Template:Cd. Earlier Windows installations used Template:Cd.<ref>Microsoft Learn: GDK migration on Windows</ref><ref>Mojang: Bedrock Edition 1.21.120 changelog</ref> See Minecraft:com.mojang for platform-specific locations.
26.40 added Windows world cloud backup and synchronization.<ref name="release-2640">Mojang: Bedrock Edition 26.40 changelog</ref>
LevelDB format
Mojang variant
Mojang's LevelDB implementation extends Google's LevelDB with zlib compression support. Database readers must support the compression types used by the world.<ref name="mojang-leveldb" /> A Java implementation is available as leveldb-mcpe-java.
The database is stored in the world's Template:Cd directory. Pass this directory to the LevelDB API rather than an individual database file. LevelDB manages its table files, journals, and manifests together.<ref name="leveldb-files">Google: LevelDB implementation</ref>
Chunk key format
A database key for data regarding a chunk is the concatenation of:
- Two signed 32-bit little-endian integers (x and z in chunk coordinates, respectively),
- An optional third 32-bit little-endian integer (1 for the Minecraft:Nether, 2 for the Minecraft:End, omitted for the Minecraft:Overworld, except for "JigsawStructureBlueprint" records, where this third integer is always present),
- A one-byte tag specifying the type of record represented by the key (see table),
- (for a "SubChunkPrefix" record) a signed one-byte subchunk Y index, and
- (for a "JigsawStructureBlueprint" record) an eight-byte structure ID.
Accordingly, such a key may be 9, 10, 13, 14, or 21 bytes long. Not all subchunks necessarily exist for a given chunk. The Y index is the block Y coordinate divided by 16, rounded down. Negative indices represent terrain below Y=0; readers must not assume every dimension has only 16 subchunks.<ref name="subchunk-code">arnis: Bedrock world reader and writer</ref>
The "BlockEntity" and legacy "Entity" records are represented by a sequence of concatenated root tags in a variant of Minecraft:NBT which stores the lengths and the multi-byte integer types in little-endian format, as opposed to the big-endian format used by Template:El or the original NBT specification.
The Template:Cd record identifies the chunk storage version. It is separate from the subchunk version, the Template:Cd header version, and the network protocol version.
| Tag byte | Name | Structure | Description | ||
|---|---|---|---|---|---|
| Dec | Hex | ASCII | |||
| 43 | 2B | Template:Cd | Data3D | Heightmap (256×2 bytes)
Biome data (varying lengths) |
Biomes are stored as palettes similar to blocks. The layout depends on the storage version and dimension. Template:Info needed |
| 44 | 2C | Template:Cd | Version | 1 byte | A byte |
| 45 | 2D | Template:Cd | Data2D | Heightmap (256×2 bytes)
2D biomes (256×1 bytes or 256×2 bytes) |
Biome IDs are written as 8-bit integers (or 16-bit little-endian integers in v1.21.40.23+). No longer written since v1.18.0, except for worlds using the Minecraft:Old world type or an older base game version (the Template:Cd level.dat property). |
| 46 | 2E | Template:Cd | Data2DLegacy | Heightmap (256×2 bytes)
2D biomes (256×4 bytes) |
Each entry of the biome array contains a biome ID in the first byte, and the final 3 bytes are red/green/blue respectively. No longer written since v1.0.0. |
| 47 | 2F | Template:Cd | SubChunkPrefix | Subchunk version (1 byte) Version-dependent data | Terrain for a 16×16×16 subchunk |
| 48 | 30 | Template:Cd | LegacyTerrain | Block IDs (32768 bytes)
Block meta (32768 nibbles) Block sky light (32768 nibbles) Block light (32768 nibbles) Heightmap (256×1 bytes) 2D biomes (256×4 bytes) |
Data ordered in XZY order, unlike Java.
No longer written since v1.0.0. Biomes are IDs plus RGB colours similar to Data2DLegacy. |
| 49 | 31 | Template:Cd | BlockEntity | List of NBT compound roots | Minecraft:Block entity data (little-endian NBT) |
| 50 | 32 | Template:Cd | Entity | List of NBT compound roots | Legacy Minecraft:entity data (little-endian NBT). See Entity storage for modern records. |
| 51 | 33 | Template:Cd | PendingTicks | NBT compound root | Pending tick data (little-endian NBT) |
| 52 | 34 | Template:Cd | LegacyBlockExtraData | Entry count (4 bytes)
Entries: Key (4 bytes), Value (2 bytes). |
Array of blocks that appear in the same place as other blocks. Used for grass appearing inside snow layers prior to v1.2.13. No longer written as of v1.2.13. |
| 53 | 35 | Template:Cd | BiomeState | ||
| 54 | 36 | Template:Cd | FinalizedState | 4 bytes | A 32-bit little endian integer |
| 55 | 37 | Template:Cd | ConversionData | No longer used | |
| 56 | 38 | Template:Cd | BorderBlocks | Education Edition Feature | |
| 57 | 39 | Template:Cd | HardcodedSpawners | Bounding boxes for structure spawns stored in binary format | |
| 58 | 3A | Template:Cd | RandomTicks | NBT compound root | Random tick data (little-endian NBT) |
| 59 | 3B | Template:Cd | Checksums | xxHash checksums of other chunk records. No longer written as of v1.18.0. | |
| 61 | 3D | Template:Cd | MetaDataHash | ||
| 62 | 3E | Template:Cd | GeneratedPreCavesAndCliffsBlending | Not used | |
| 63 | 3F | Template:Cd | BlendingBiomeHeight | Not used | |
| 64 | 40 | Template:Cd | BlendingData | ||
| 65 | 41 | Template:Cd | ActorDigestVersion | ||
| 118 | 76 | Template:Cd | LegacyVersion | 1 byte | Moved to 44 in v1.16.100 |
| 119 | 77 | Template:Cd | AABBVolumes | ||
| 120 | 78 | Template:Cd | JigsawStructureBlueprint | ||
The tag assignments are version-dependent. Microsoft's published actor-storage documentation gives different assignments for tags Template:Cd-Template:Cd from the table above. These entries require verification against the world version being read.<ref name="actor-storage">Microsoft Learn: Actor storage in Minecraft</ref>
Subchunk storage
A subchunk contains a 16×16×16 block volume. Paletted subchunks store block indices and a palette of block states.
| Version | Header |
|---|---|
| 8 | Version byte and one-byte storage-layer count. |
| 9 | Version byte, storage-layer count, and signed one-byte subchunk Y index. |
Each layer starts with a byte whose upper seven bits specify the bits per palette index. Bit 0 distinguishes persistent palettes from runtime palettes. Disk block palettes use little-endian NBT rather than network runtime IDs.
For nonzero bit widths, indices occupy little-endian 32-bit words. Each word holds Template:Cd indices; remaining bits are padding. The 4096 indices use XZY order, with Y changing fastest. The index words are followed by a four-byte little-endian palette count and the palette's NBT compounds.<ref name="subchunk-code" /> Multiple layers allow blocks and fluids to occupy the same position.<ref>Tommaso Checchi: Block changes in Beta 1.2.13</ref>
Entity storage
Modern worlds store entities individually under Template:Cd keys. An entity's ID remains stable between play sessions and is unique within its world. Separate Template:Cd records hold the chunk's entity-key digest. Readers must handle these records rather than relying only on the legacy Template:Cd chunk record.<ref name="actor-storage" /> Block entities use their separate chunk record.
Other keys
There's also the special key ~local_player for an entity data entry that holds the local player entity. The value associated with the ~local_player key is NBT encoded and has only a single compound tag at the root level.
Remote-player records use keys beginning with Template:Cd. The suffix depends on the identity system and world version; the historical Template:Cd convention does not describe every current world. Values contain a little-endian NBT root compound.
There's also a special "game_flatworldlayers" key of length 20 for flat worlds. The value associated with this key is a set of numbers in ASCII text format. An example of a value associated with the "game_flatworldlayers" key is "[7,3,3,2]" where the value length for this example is 9.
There are several keys related to villages. Depending on the dimension, the village key is prefixed with VILLAGE_DIMENSION_[0-9a-f\\-]+_, with DIMENSION being replaced with the dimension's name.
- DWELLERS
- Consists mainly of an entity/mob ID's. Dwellers include villagers, iron golems, and cats.
- INFO
- Includes the village bounding box.
- POI
- Provides a mapping between villagers and their beds, village center (bell) and work station.
- PLAYERS
Other keys start with the following strings
- actorprefix
- digp
- legacy_console_player_
- map_
- portals
- schedulerWT
- structuretemplate
- tickingarea
- DynamicProperties
- scoreboard
- Overworld
- Nether
- TheEnd
- AutonomousEntities
- BiomeData
- mobevents
- LevelChunkMetaDataDictionary
- RealmsStoriesData_
- DedicatedServerForcedCorruption
- SST_SALOG
- SST_WORD
- SST_WORD_
An official explanation from Microsoft about how entities (actors) are stored in LevelDB can be found on Microsoft Learn / Minecraft Bedrock Edition.
Implementations
- An example implementation of a Bedrock level-db parser can be found in minecraft_mmccoo. This implementation walks the NBTs of all block, entities/mobs, elevations, and village related items.
- A more up-to-date TypeScript implementation can be found on the mcbe-leveldb NPM package.
NBT structures
The following articles document NBT structures used by world data.
level.dat
The Template:Cd file contains uncompressed little-endian NBT with an eight-byte header. The first four bytes hold the file-format version as a little-endian integer; the next four hold the NBT payload length, excluding the header. Version 10 is used by modern saves. Readers should check the stored version rather than assuming it matches the game release. Template:Info needed
NBT structure
Tags depend on the game version, platform, and world settings. This list includes legacy and optional fields and is not a complete schema for every release. Preserve unrecognized fields when editing a world.
In 26.30, Template:Cd was replaced by Template:Cd. Existing true and false settings migrate to Template:Cd and Template:Cd, respectively. The exact NBT name, type, and stored enum values for the replacement still need documentation.<ref name="release-2630">Mojang: Bedrock Edition 26.30 changelog</ref>
Since 26.40, NBT lists and compounds have a nesting limit of 512.<ref name="release-2640" />
- Template:Nbt: World data.
- Template:Nbt: The default permissions for players in the world.
- Template:Nbt: 1 or 0 (true/false) - true if the player can attack mobs.
- Template:Nbt: 1 or 0 (true/false) - true if the player can attack other players.
- Template:Nbt: 1 or 0 (true/false) - true if the player can place blocks.
- Template:Nbt: 1 or 0 (true/false) - true if the player is able to interact with redstone components.
- Template:Nbt: 1 or 0 (true/false) - true if the player is currently flying.
- Template:Nbt: The flying speed; the default is 0.05.
- Template:Nbt: 1 or 0 (true/false) - true if the player can instantly destroy blocks.
- Template:Nbt: 1 or 0 (true/false) - true if the player is immune to all damage and harmful effects.
- Template:Nbt: 1 or 0 (true/false) - true if the player was struck by lightning.
- Template:Nbt: 1 or 0 (true/false) - true if the player can fly.
- Template:Nbt: 1 or 0 (true/false) - true if the player can destroy blocks.
- Template:Nbt: 1 or 0 (true/false) - true if the player messages cannot be seen by other players.
- Template:Nbt: 1 or 0 (true/false) - true if the player can phase through blocks.
- Template:Nbt: 1 or 0 (true/false) - true if the player has operator commands.
- Template:Nbt: 1 or 0 (true/false) - true if the player is able to open containers.
- Template:Nbt: 1 or 0 (true/false) - true if the player is allowed to teleport.
- Template:Nbt: The vertical flight speed. Template:Info needed
- Template:Nbt: The walking speed; the default is 0.1.
- Template:Nbt: 1 or 0 (true/false) - true if the player is a world builder. (Removed 1.21.120 Template:Info needed)
- Template:Nbt: The Template:Cd Minecraft:game rule. Template:Info needed
- Template:Nbt: The Template:Cd Minecraft:game rule. Template:Info needed
- Template:Nbt: The version of Minecraft that is the maximum version to load resources from. Eg. setting this to Template:Cd removes any features that were added after version Template:Cd.
- Template:Nbt: Makes the world into a Minecraft:single biome world and the biome set here is the biome of this single biome world.
- Template:Nbt: 1 or 0 (true/false) - true if the bonus chest is enabled.
- Template:Nbt: 1 or 0 (true/false) - true if the bonus chest has been placed in the world. Turning this to false spawns another bonus chest near the spawn coordinates.
- Template:Nbt: Template:Info needed
- Template:Nbt: 1 or 0 (true/false) - true if the maps should be on a grid or centered to exactly where they are created. Default to 0.
- Template:Nbt: 1 or 0 (true/false) - true if cheats are on.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Template:Info needed
- Template:Nbt: 1 or 0 (true/false) - tells if the world has Platform-Specific texture packs or content. Used to prevent cross play in specific worlds, that use assets allowed only on specific consoles.
- Template:Nbt: Template:Info needed
- Template:Nbt: Template:Info needed
- Template:Nbt: The current difficulty setting. 0 is Peaceful, 1 is Easy, 2 is Normal, and 3 is Hard.
- Template:Nbt: The dimension the player is in. 0 is the Overworld, 1 is the Nether, and 2 is the End. Template:Info needed
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Minecraft:Editor world type. 0 is World, 1 is Project.
- Template:Nbt: Enables the Template:Cd resource and behavior packs for the world, containing some features from Minecraft:Minecraft Education.
- Template:Nbt: A Minecraft:UUID. Template:Info needed
- Template:Nbt: Template:Info needed
- Template:Nbt: Marks a world as a Minecraft:Minecraft Education world (worlds with this set to 1 do not open on Minecraft:Bedrock Edition!).
- Template:Nbt
- Template:Nbt: Unused in Bedrock Edition, but is used in Education Edition as part of the Resource Link feature on the Pause Screen. It defines the Resource Link Button Text.
- Template:Nbt: Unused in Bedrock Edition, but is used in Education Edition as part of the Resource Link feature on the Pause Screen. It defines what link opens upon clicking the Resource Link Button.
- Template:Nbt
- Template:Nbt: 1 or 0 (true/false) - true if the world is locked on Minecraft:experimental gameplay.
- Template:Nbt: 1 or 0 (true/false) - true if the world has been saved with experiments on before.
- ... Additional bytes for each experiment that Minecraft has/had.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: JSON that controls generation of flat worlds. The Template:Cd array must contain at least 2 valid blocks, otherwise the world will generate as void. Default is Template:Cd}.
- Template:Nbt: The Template:Cd Minecraft:game rule. Template:Info needed
- Template:Nbt: 1 or 0 (true/false) - true if force the player into the game mode defined in Template:Cd.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The default game mode of the player. 0 is Minecraft:Survival, 1 is Minecraft:Creative, 2 is Minecraft:Adventure, 5 is Default, and 6 is Minecraft:Spectator.
- Template:Nbt: The world type. 0 is Minecraft:Old, 1 is Infinite, 2 is Minecraft:Flat, 5 is Void, and others are Infinite with the bedrock layer at 0.
- Template:Nbt: Whether the world has Minecraft:achievements locked. Set to 1 if the default game mode is set to Creative, if cheats have been enabled, or when achievements have otherwise been disabled. Equipping a behavior pack does not universally disable achievements in current releases.<ref name="release-2630" />
- Template:Nbt: Template:Info needed
- Template:Nbt: Template:Info needed
- Template:Nbt: Template:Info needed
- Template:Nbt: Is read-only.
- Template:Nbt: Template:Info needed
- Template:Nbt: 1 or 0 (true/false) - true if it was created from the Minecraft:Bedrock Editor.
- Template:Nbt: 1 or 0 (true/false) - true if exported from the Bedrock Editor.
- Template:Nbt: 1 or 0 (true/false) - true if the world is created from a world template where the world options were intended not to be modified.
- Template:Nbt: 1 or 0 (true/false) - true if the world is created from a Minecraft:world template.
- Template:Nbt: 1 or 0 (true/false) - true if the world is in Minecraft:Hardcore mode.
- Template:Nbt: 1 or 0 (true/false) - true if the world template generates with a new, random seed.
- Template:Nbt: 1 or 0 (true/false) - (unused) may cause world to not save, or delete after use. Seems to default back to false when a world is loaded.
- Template:Nbt: 1 or 0 (true/false) - true if the world options cannot be modified until the user accepts that they are changing the map.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Whether the world has been opened with the "Visible to LAN players" world setting enabled.
- Template:Nbt: Whether the "Visible to LAN players" world toggle is enabled.
- Template:Nbt: Five Template:Nbts representing the last version with which the world was opened. Eg. for the beta/Preview 1.20.30.22 the version is Template:Cd.
- Template:Nbt: Stores a timestamp of when the world was last played as the number of seconds since the epoch (1/1/1970).
- Template:Nbt: Specifies the name of the world.
- Template:Nbt: Related to the current strength of Minecraft:thunderstorms.Template:Info needed
- Template:Nbt: Template:Info neededRelated to the Minecraft:weather cycle regarding thunderstorms.
- Template:Nbt: The X coordinate where limited (old) world generation started.
- Template:Nbt: The Y coordinate where limited (old) world generation started.
- Template:Nbt: The Z coordinate where limited (old) world generation started.
- Template:Nbt: The width (in chunks) of the borders surrounding the (old) world generation. Defaults to 16.
- Template:Nbt: The depth (in chunks) of the borders surrounding the (old) world generation. Defaults to 16.
- Template:Nbt: The legacy Template:Cd Minecraft:game rule, replaced in 26.30.<ref name="release-2630" />
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Five Template:Nbts representing the minimum compatible client version that is needed to open the world. Eg. for the beta/Preview 1.20.30.22 the minimum compatible version is Template:Cd.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Whether the world has been opened with the "Multiplayer Game" world setting enabled.
- Template:Nbt: Whether the "Multiplayer Game" world toggle is enabled.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The horizontal coordinate scale between the Overworld and Nether. The default of 8 means one Nether block corresponds to eight Overworld blocks.
- Template:Nbt: The Minecraft:protocol version of the version the world was last played on.
- Template:Nbt: What permissions a player defaults to, when joining a world.
- Template:Nbt: Seems to store the platform that the level is created on. Currently observed value is 2.
- Template:Nbt: Template:Info needed
- Template:Nbt: 1 or 0 (true/false) - true if a player has died.Template:Info needed
- Template:Nbt: What permissions a player has.
- Template:Nbt: The Template:Cd Minecraft:game rule, values above 100 mean that night will never turn into day.
- Template:Nbt: The UUID of the premium world template this world was created with. Used for Marketplace worlds.Template:Info needed
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Related to the current strength of Minecraft:rain.Template:Info needed
- Template:Nbt: Related to the Minecraft:weather cycle regarding rain.Template:Info needed
- Template:Nbt: Level seed.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Template:Info needed
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Simulation distance.Template:Info needed
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: 1 or 0 (true/false) - true if mobs can spawn.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Spawn pre-1.10.0 villagers.
- Template:Nbt: The X coordinate of the player's spawn position. Defaults to 0.
- Template:Nbt: The Y coordinate of the player's spawn position. Defaults to 64.
- Template:Nbt: The Z coordinate of the player's spawn position. Defaults to 0.
- Template:Nbt: 1 or 0 (true/false) - true if new players spawn with a locator map.
- Template:Nbt: Version of Bedrock Edition Storage Tool, currently is 10.
- Template:Nbt: 1 or 0 (true/false) - true if the user must download the texture packs applied to the world to join.
- Template:Nbt: Stores the current "time of day" in ticks. There are 20 ticks per real-life second, and 24000 ticks per Minecraft Minecraft:daylight cycle, making the full cycle length 20 minutes. 0 is the start of daytime, 12000 is the start of sunset, 13800 is the start of nighttime, 22200 is the start of sunrise, and 24000 is daytime again. The value stored in level.dat is always increasing and can be larger than 24000, but the "time of day" is always modulo 24000 of the "Time" field value.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: The Template:Cd Minecraft:game rule.
- Template:Nbt: Whether the world is restricted to Microsoft Accounts only (players must be signed in).
- Template:Nbt: Template:Info needed
- Template:Nbt: Counts how many times the game has been closed since the world was created, with its value decreasing by 1 each time.
- Template:Nbt: Template:Info needed
- Template:Nbt: The Minecraft:multiplayer exposure for the Xbox friends system, corresponding to the "Microsoft Account Settings" world setting. 0 is disabled, 1 is "Invite Only," 2 is "Friends Only," and 3 is "Friends of Friends."
- Template:Nbt: The default permissions for players in the world.
Database files and logs
LevelDB uses several files in Template:Cd:<ref name="leveldb-files" />
- Template:Cd identifies the active manifest.
- Template:Cd files describe the database's table files and state.
- Template:Cd files contain sorted key-value tables.
- Numbered Template:Cd files are binary write-ahead journals used to recover recent writes.
- Template:Cd and Template:Cd are human-readable diagnostic logs.
- Template:Cd coordinates access to the database.
The diagnostic Template:Cd is separate from the binary journal format. A diagnostic entry can look like this:
2014/07/24-22:20:08.400488 4a3638 Recovering log #3
History
See also
References
Template:Navbox Bedrock Edition
Minecraft:de:Weltdaten (Bedrock) Minecraft:es:Formato de nivel de Bedrock Edition Minecraft:ja:ワールドフォーマット/Bedrock Edition Minecraft:nl:Bedrockeditie level format Minecraft:pt:Formato de nível da Edição Bedrock Minecraft:zh:基岩版存档格式