Level Format
Byte Order
level.dat is stored in Little Endian byte order.
Parsing level.dat
Part 1 (Getting the level NBT data)
Name | Size (in bytes) | Description |
---|---|---|
Version | 4 | The version used to save the file. Always 3. |
Size | 4 | The size of the file subtracting the header. |
NBT Compound | Variable | The NBT data of the level. |
Part 2 (Reading the NBT data)
- World data
- GameType: Whether in survival (0) or in creative (1) mode.
- LastPlayed: Stores the Unix time stamp (in seconds) when the player saved the game.
- LevelName: Specifies the name of the level.
- Platform: Seems to store the platform that the level is created on. Currently observed value is 2.
- Player: Player entity information.
- Air: The number of ticks before the player starts to drown. Defaults to 300 and decresses when underwater.
- Armor: Each 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.
- id: Item or Block ID.
- Damage: For 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.
- Count: Number 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.
- AttackTime: Number of ticks the player is immune to attacks for.
- BedPositionX: The X position of the bed the player last slept in.
- BedPositionY: The Y position of the bed the player last slept in.
- BedPositionZ: The Z position of the bed the player last slept in.
- DeathTime: Number of ticks the player has been dead for. (used for death animation)
- Dimension: The dimension the player is in. 0 is the Overworld.
- FallDistance: How far the player has fallen.
- Fire: The number of ticks until the fire is put out. Negative values reflect how long the player can stand in fire before burning. Default -20.
- Health: The number of hit points the player has. 20 is 10 hearts.
- HurtTime: Number of ticks the player is red from being attacked.
- Inventory: Each CompoundTag in this list defines an item the player is carrying or holding.
- id: Item or Block ID.
- Damage: For 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.
- Count: Number 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.
- Slot: Indicates which inventory slot this item is in.
- Motion: The players motion in the X,Y, and Z directions. This list has a length of 3.
- OnGround: 1 or 0 (true/false) - true if the player is on the ground.
- Pos: The X,Y, and Z coordinates of the players position. This list has a length of 3.
- Rotation: The players looking pitch and yaw. This list has a length of 2.
- Score: The score of the player.
- SleepTimer: The number of ticks the player had been in bed when this tag was saved. No effect.
- Sleeping: 1 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.
- SpawnX: X coordinate of the player's spawn position. Default is 0.
- SpawnY: Y coordinate of the player's spawn position. Default is 64.
- SpawnZ: Z coordinate of the player's spawn position. Default is 0.
- RandomSeed: Random number providing the Random Seed for the terrain.
- SizeOnDisk: Estimated size of the entire world in bytes.
- SpawnX: X coordinate of the world's spawn position. Default is 0.
- SpawnY: Y coordinate of the world's spawn position. Default is 64.
- SpawnZ: Z coordinate of the world's spawn position. Default is 0.
- StorageVersion: Version of Bedrock Edition NBT, is 3.
- Time: Stores 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.
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