Skip to content

Level Format

Byte Order

level.dat is stored in Little Endian byte order.

Parsing level.dat

Part 1 (Getting the level NBT data)

NameSize (in bytes)Description
Version4The version used to save the file. Always 3.
Size4The size of the file subtracting the header.
NBT CompoundVariableThe NBT data of the level.

Part 2 (Reading the NBT data)

Tag NameTag TypeDescription
GameTypeIntTagWhether in survival (0) or in creative (1) mode.
LastPlayedLongTagStores the Unix time stamp (in seconds) when the player saved the game.
LevelNameStringTagSpecifies the name of the level.
PlatformIntTagSeems to store the platform that the level is created on. Currently observed value is 2.
PlayerCompoundTagPlayer entity information.
RandomSeedLongTagRandom number providing the Random Seed for the terrain.
SizeOnDiskLongTagEstimated size of the entire world in bytes.
SpawnXIntTagX coordinate of the world's spawn position. Default is 0.
SpawnYIntTagY coordinate of the world's spawn position. Default is 64.
SpawnZIntTagZ coordinate of the world's spawn position. Default is 0.
StorageVersionIntTagVersion of Bedrock Edition NBT, is 3.
TimeLongTagStores the current "time of day" in ticks. There are 20 ticks per real-life second, and 19200 ticks per Minecraft daylight cycle, making the full cycle length 16 minutes—4 minutes shorter than the standard 20 minute daylight cycle.

Player Data

Tag NameTag TypeDescription
AirShortTagThe number of ticks before the player starts to drown. Defaults to 300 and decresses when underwater.
ArmorListTag of CompoundTagsEach CompoundTag in this list defines a piece of armor that the player is wearing. This is a list with length 4 - for helmet, chestplate, leggings, and boots.
AttackTimeShortTagNumber of ticks the player is immune to attacks for.
BedPositionXIntTagThe X position of the bed the player last slept in.
BedPositionYIntTagThe Y position of the bed the player last slept in.
BedPositionZIntTagThe Z position of the bed the player last slept in.
DeathTimeShortTagNumber of ticks the player has been dead for. (used for death animation)
DimensionIntTagThe dimension the player is in. 0 is the Overworld.
FireShortTagThe number of ticks until the fire is put out. Negative values reflect how long the player can stand in fire before burning. Default -20.
HealthShortTagThe number of hit points the player has. 20 is 10 hearts.
HurtTimeShortTagNumber of ticks the player is red from being attacked.
InventoryListTag of CompoundTagsEach TAG_Compound in this list defines an item the player is carrying or holding.
MotionListTag of FloatTagsThe players motion in the X,Y, and Z directions. This list has a length of 3.
OnGroundByteTag1 or 0 (true/false) - true if the player is on the ground.
PosListTag of FloatTagsThe X,Y, and Z coordinates of the players position. This list has a length of 3.
RotationListTag of FloatTagsThe players looking pitch and yaw. This list has a length of 2.
ScoreIntTagThe score of the player.
SleepTimerShortTagThe number of ticks the player had been in bed when this tag was saved. No effect.
SleepingByteTag1 or 0 (true/false) - true if the player was in a bed when this tag was saved; has no effect on whether the player is in a bed when they log in.
SpawnXIntTagX coordinate of the player's spawn position. Default is 0.
SpawnYIntTagY coordinate of the player's spawn position. Default is 64.
SpawnZIntTagZ coordinate of the player's spawn position. Default is 0.

Armor Data

Tag NameTag TypeDescription
idShortTagItem or Block ID.
DamageShortTagFor armor, the amount of wear they have suffered. The maximum durability of the armor means undamaged. When the Damage reaches 0, it breaks and disappears.
CountByteTagNumber of items stacked in this inventory slot. Any item can be stacked, including tools. Range is 1-255. Values above 255 are not displayed in-game.

Inventory Data

Tag NameTag TypeDescription
idShortTagItem or Block ID.
DamageShortTagFor armor, the amount of wear they have suffered. The maximum durability of the armor means undamaged. When the Damage reaches 0, it breaks and disappears.
CountByteTagNumber of items stacked in this inventory slot. Any item can be stacked, including tools. Range is 1-255. Values above 255 are not displayed in-game.
SlotByteTagIndicates which inventory slot this item is in.

License & Credits

This file is licensed under CC BY-NC-SA 3.0.

The information here is from this Minecraft wiki page with some wording tweaked and/or simplify

Contributors

The avatar of contributor named as BJTMastermind BJTMastermind

Changelog

Contributors



Documentation page was setup by DexrnZacAttack.


Documentation is licensed under Creative Commons CC-BY 4.0 unless otherwise noted. For more info, check the NOTICE file.