Java Edition level format

Each level is its own folder. A level folder is often identified by having a level.dat file, along with other subfolders to store the maps and regions of the level.

Level folders will always contain the items in bold, and will sometimes contain the items in italics.

level.dat format
The  level.dat  file contains global information about the world such as the time of day, the singleplayer player, the level generator used, and the seed. It is an NBT file with this structure:
 * The root tag.
 * This tag contains all the level data.
 * {{nbt|byte|allowCothe Z coordinate. Defaults to 0.
 * {{nbt|double|BorderDamagePerBlock}}: Defaults to 0.2.
 * {{nbt|double|BorderSize}}: Width and length of the border of the border. Defaults to 60000000.
 * {{nbt|double|BorderSafeZone}}: Defaults to 5.
 * {{nbt|double|BorderSizeLerpTarget}}: Defaults to 60000000.
 * {{nbt|long|BorderSizeLerpTime}}: Defaults to 0.
 * {{nbt|double|BorderWarningBlocks}}: Defaults to 5.
 * {{nbt|double|BorderWarningTime}}: Defaults to 15.
 * {{nbt|int|clearWeatherTime}}: The number of ticks until "clear weather" has ended.
 * {{nbt|compound|CustomBossEvents}}: A collection of bossbars.
 * {{nbt|compound|ID}}: The ID of a bossbar (e.g. )
 * {{nbt|list|Players}}: A list of players that may see this boss bar.
 * A single player
 * {{nbt|long|L}}: The least significant bits of the player's Universally Unique IDentifier. This is joined with M to form the player's unique ID.
 * {{nbt|long|M}}: The most significant bits of the player's Universally Unique IDentifier. This is joined with L to form the player's unique ID.
 * {{nbt|string|Color}}: ID of the color of the bossbar. Also sets the color of the display text of the bossbar, provided that the display text does not explicitly define a color for itself. See color codes for accepted values.
 * {{nbt|byte|CreateWorldFog}}: 1 or 0 (true/false) - If the bossbar should create fog.
 * {{nbt|byte|DarkenScreen}}: 1 or 0 (true/false) - If the bossbar should darken the sky.
 * {{nbt|int|Max}}: The maximum health of the bossbar.
 * {{nbt|int|Value}}: The current health of the bossbar.
 * {{nbt|string|Name}}: The display name of the bossbar as a JSON text component.
 * {{nbt|string|Overlay}}: The ID of the overlay to be shown over the health bar. Accepted values are:,  ,  ,  , and.
 * {{nbt|byte|PlayBossMusic}}: 1 or 0 (true/false) - If the bossbar should initiate boss music.
 * {{nbt|byte|Visible}}: 1 or 0 (true/false) - If the bossbar should be visible to the listed players.
 * {{nbt|compound|DataPacks}}: Options for datapacks.
 * {{nbt|list|Disabled}}: List of disabled datapacks.
 * {{nbt|string}}: A single datapack.
 * {{nbt|list|Enabled}}: List of enabled datapacks. By default, this is populated with a single string "vanilla".
 * {{nbt|string}}: A single datapack.
 * {{nbt|int|DataVersion}}: An integer displaying the data version.
 * {{nbt|byte|Difficulty}}: The current difficulty setting. 0 is Peaceful, 1 is Easy, 2 is Normal, and 3 is Hard. Defaults to 2.
 * {{nbt|byte|DifficultyLocked}}: 1 or 0 (true/false) - True if the difficulty has been locked. Defaults to 0.
 * {{nbt|long|DayTime}}: The time of day. 0 is sunrise, 6000 is mid day, 12000 is sunset, 18000 is mid night, 24000 is the next day's 0. This value keeps counting past 24000 and does not reset to 0.
 * {{nbt|compound|DimensionData}}: This tag contains level data specific to certain dimensions.
 * {{nbt|compound|1}}: Data for The End
 * {{nbt|compound|DragonFight}}: Data for the ender dragon fight. Only appears after the end is entered.
 * {{nbt|compound|ExitPortalLocation}}: Location of the End's exit portal that the ender dragon flies to upon it's death
 * {{nbt|byte|X}}: The X coordinate of the portal.
 * {{nbt|byte|Y}}: The Y coordinate of the portal.
 * {{nbt|byte|Z}}: The Z coordinate of the portal.
 * {{nbt|list|Gateways}}: Contains a list of locations of the End gateway portals that haven't been spawned.
 * {{nbt|int|}}: The angle of a future gateway, from 0 to 19. 0 is east of the exit portal, and numbers increase clockwise.
 * {{nbt|byte|DragonKilled}}: 1 or 0 (true/false) - If the dragon is currently alive.
 * {{nbt|long|DragonUUIDLeast}}: The least significant bits of the current Ender Dragon's Universally Unique IDentifier. This is joined with DragonUUIDMost to form the dragon's unique ID.
 * {{nbt|long|DragonUUIDMost}}: The most significant bits of the current Ender Dragon's Universally Unique IDentifier. This is joined with DragonUUIDLeast to form the dragon's unique ID.
 * {{nbt|byte|PreviouslyKilled}}: 1 or 0 (true/false) - If the ender dragon has ever been defeated. Used to determine EXP given by dragon
 * {{nbt|int|GameType}}: The default game mode for the singleplayer player when they initially spawn. 0 is Survival, 1 is Creative, 2 is Adventure, 3 is Spectator. Note: Singleplayer worlds do not use this field to save which game mode the player is currently in.
 * {{nbt|compound|GameRules}}: The gamerules used in the world.
 * {{nbt|string|Rule name}}: The value for the given rule. This is always an NBT string, which is either   or   for the majority of rules (with it being a number for some other rules, and any arbitrary string for a user-defined rule)
 * {{nbt|string|generatorName}}: The name of the generator; {{cd|default}}, {{cd|flat}}, {{cd|largeBiomes}}, {{cd|amplified}}, {{cd|buffet}}, {{cd|debug_all_block_states}} or {{cd|default_1_1}}. Not case sensitive, but always written in the case here. The last one can only exist if the file was edited. It is a variation of the default generation. It can also be {{cd|customized}} if it is a customized world from before 1.13. In this case the world will become {{cd|default}} if opened using 1.13 or newer.
 * {{nbt|compound|generatorOptions}}: Used in buffet, superflat and old customized worlds. Format below.
 * {{nbt|int|generatorVersion}}: The version of the level generator. The effects of changing this are unknown, but values other than 0 have been observed.
 * {{nbt|byte|hardcore}}: 1 or 0 (true/false) - true if the player will respawn in Spectator on death in singleplayer. Affects all three game modes.
 * {{nbt|byte|initialized}}: 1 or 0 (true/false) - Normally true after a world has been initialized properly after creation. If the initial simulation was canceled somehow, this can be false and the world will be re-initialized on next load.
 * {{nbt|long|LastPlayed}}: The Unix time in milliseconds when the level was last loaded.
 * {{nbt|string|LevelName}}: The name of the level.
 * {{nbt|byte|MapFeatures}}: 1 or 0 (true/false) - true if the map generator should place structures such as villages, strongholds, and mineshafts. Defaults to 1. Always 1 if the world type is Customized.
 * {{nbt|compound|Player}}: The state of the Singleplayer player. This overrides the .dat file with the same name as the Singleplayer player. This is only saved by Servers if it already exists, otherwise it is not saved for server worlds. See Player.dat Format.
 * {{nbt|long|RandomSeed}}: The random level seed used to generate consistent terrain.
 * {{nbt|byte|raining}}: 1 or 0 (true/false) - true if the level is currently experiencing rain, snow, and cloud cover.
 * {{nbt|int|rainTime}}: The number of ticks before "raining" is toggled and this value gets set to another random value.
 * {{nbt|long|SizeOnDisk}}: The estimated size in bytes of the level. Currently not modified or used by Minecraft, but was previously.
 * {{nbt|int|SpawnX}}: The X coordinate of the world spawn.
 * {{nbt|int|SpawnY}}: The Y coordinate of the world spawn.
 * {{nbt|int|SpawnZ}}: The Z coordinate of the world spawn.
 * {{nbt|byte|thundering}}: 1 or 0 (true/false) - true if the rain/snow/cloud cover is a lightning storm and dark enough for mobs to spawn under the sky.
 * {{nbt|int|thunderTime}}: The number of ticks before "thundering" is toggled and this value gets set to another random value.
 * {{nbt|long|Time}}: The number of ticks since the start of the level.
 * {{nbt|int|version}}: The NBT version of the level, with 1.14.4 being 19133.
 * {{nbt|compound|Version}}: Information about the Minecraft version the world was saved in.
 * {{nbt|int|Id}}: An integer displaying the data version.
 * {{nbt|string|Name}}: The version name as a string, e.g. "15w32b".
 * {{nbt|byte|Snapshot}}: 1 or 0 (true/false) – Whether the version is a snapshot or not.
 * {{nbt|string|WanderingTraderId}}: The UUID of the current wandering trader in the world.
 * {{nbt|int|WanderingTraderSpawnChance}}: The current chance of the wandering trader spawning next attempt; this value is the percentage and will be divided by 10 when loaded by the game, for example a value of 50 means 5.0% chance.
 * {{nbt|int|WanderingTraderSpawnDelay}}: The amount of ticks until another wandering trader is attempted to spawn

generatorOptions tag format
The tag format varies depending on the generator name. This is the format for buffet worlds:


 * : A biome ID
 * : The biome generator, cannot be selected in-game and will be  for unmodified worlds, but can be   or.
 * : A block ID, by default.
 * : A fluid ID, by default.
 * : The generator ID used. Can be,   or.
 * : The biome generator, cannot be selected in-game and will be  for unmodified worlds, but can be   or.
 * : A block ID, by default.
 * : A fluid ID, by default.
 * : The generator ID used. Can be,   or.
 * : A fluid ID, by default.
 * : The generator ID used. Can be,   or.

This is the format for superflat worlds:


 * : An empty compound named as the structure in the generator settings, for example "village". If properties are set, for example in the preset:, then the compound contains this information.
 * : A property. Its value is a number, but the tag is a string.
 * : A layer
 * : The block ID.
 * : The height of the layer, used in worlds created before 1.13.
 * : The height of the layer, used in worlds created in 1.13.
 * : The biome ID.
 * : The height of the layer, used in worlds created before 1.13.
 * : The height of the layer, used in worlds created in 1.13.
 * : The biome ID.

This is the format for customized worlds that are created before 18w06a.

session.lock format
This file contains the timestamp of when the level was last accessed. The file contains a single 64-bit integer in big endian format, which is the timestamp, stored as the number of milliseconds elapsed since 1970-01-01 00:00:00, in UTC.

Unlike typical lock files, this file ensures that the last program to access the level is that one that has read and write access. The process goes something like this:
 * 1) Program opens session.lock
 * 2) Program writes timestamp to session.lock
 * 3) Program monitors session.lock for changes
 * 4) If the contents of session.lock change, program aborts and gives up its lock on the level.

Minecraft can sometimes try to hold the lock on a level even after the player has started playing a different level, and this can cause strange behavior. It is recommended to ensure that Minecraft is closed before trying to acquire a lock on a level.

poi format
Files in  poi  folder use similar structure to  region  Anvil files (hence the  mca  extension), but the NBT content is different.


 * The root tag.
 * This tag contains all the level data.
 * Keys are whole numbers (possibly chunk height sections).
 * (only observed value so far was 1)
 * May be empty.
 * Single record.
 * 3-element array encoding X, Y and Z
 * Typically 1 or 0, but can be over 30 for type.
 * Type of the point, for example:,  ,  ,  , etc.
 * Structure version. As of 1.14.4 the value is 1976.
 * Structure version. As of 1.14.4 the value is 1976.

Level Format Format de niveau Level formaat Level格式 Levelフォーマット