Minecraft:Java Edition Indev level format
More actions
Template:Outdated The .mclevel map format is an old map format created by Notch. It is based on the Minecraft:NBT format and is GZip compressed.
The map format was in use since Indev 0.31 20100122-2251 up until Indev 20100223, after which it became non-functional and would stay that way until Infdev 20100327 when it was outright removed.
While Alpha (and Infdev) levels use NBT files, they have a very different file format.
For details on the infinite map format, see Minecraft:Java Edition Alpha level format.
NBT structure
- Template:Nbt: The root tag.
- Template:Nbt: Information about the level.
- Template:Nbt: The Unix time when the level was created.
- Template:Nbt: The name of the level, always "A Nice World."
- Template:Nbt: The name of the user who created the level.
- Template:Nbt: Information about the level's environment, which varies based on the map generation settings.
- Template:Nbt: The time in ticks affecting daylight cycle. Range 0 - 24000.
- Template:Nbt: The sky light level, 0 to 15.
- Template:Nbt: The RGB color of the sky, 24 bits. Red is SkyColor >> 16 & 255, green is SkyColor >> 8 & 255, blue is SkyColor & 255.
- Template:Nbt: The RGB color of the fog, 24 bits. Red is FogColor >> 16 & 255, green is FogColor >> 8 & 255, blue is FogColor & 255.
- Template:Nbt: The RGB color of the clouds, 24 bits. Red is CloudColor >> 16 & 255, green is CloudColor >> 8 & 255, blue is CloudColor & 255.
- Template:Nbt: The height of the clouds (Y coordinate).
- Template:Nbt: The block ID of the "surrounding ground".
- Template:Nbt: The height of the "surrounding ground".
- Template:Nbt: The block ID of the "surrounding water".
- Template:Nbt: The height of the "surrounding water".
- Template:Nbt: The actual map data.
- Template:Nbt: The width of the level.
- Template:Nbt: The length of the level.
- Template:Nbt: The height of the level.
- Template:Nbt: List of 3 TAG_Shorts for the X, Y, and Z spawn coordinates.
- Template:Nbt: Width*Length*Height bytes of block IDs. (8 bits)
- Template:Nbt: Width*Length*Height bytes of block data (4 bit) and light value (next 4 bit).
- Template:Nbt: List of TAG_Compounds for the entities in the level.
- Template:Nbt An entity. The player has its own entity, shown below as an example.
- Template:Nbt: The entity ID. In this case, "LocalPlayer".
- Template:Nbt: List of 3 TAG_Floats for the X, Y, and Z position of the player.
- Template:Nbt: List of 2 TAG_Floats for the yaw and pitch of the player's view.
- Template:Nbt: List of 3 TAG_Floats for the X, Y, and Z motion in meters per tick.
- Template:Nbt: How far the player has fallen.
- Template:Nbt: The number of hit points the player has. 20 is 10 hearts.
- Template:Nbt: Number of ticks the player is immune to attacks.
- Template:Nbt: Number of ticks the player is red from being attacked.
- Template:Nbt: Number of ticks the player has been dead for - used for controlling the death animation.
- Template:Nbt: The number of ticks before the player starts to drown. It starts at 300.
- Template:Nbt: When negative, the number of ticks before the player can catch on fire. When positive, the number of ticks before the fire is extinguished.
- Template:Nbt: The player's score.
- Template:Nbt: List of TAG_Compounds representing items in the player's inventory.
- Template:Nbt An item stack.
- Template:Nbt: The Slot the item is in.
- Template:Nbt: The Item ID.
- Template:Nbt: The item's data value, or damage value for tools.
- Template:Nbt: The number of this item in the stack. Range -128 to 127. Values less than 2 are not displayed in-game.
- Template:Nbt An item stack.
- Template:Nbt An entity. The player has its own entity, shown below as an example.
- Template:Nbt: List of TAG_Compounds for the tile entities in the level.
- Template:Nbt A tile entity.
- Template:Nbt: Tile entity id. In this case, "Chest".
- Template:Nbt: Position of the tile entity, explained later.
- Template:Nbt: List of TAG_Compounds representing items in the chest.
- Template:Nbt An item stack.
- Template:Nbt: The Slot the item is in.
- Template:Nbt: The Item ID.
- Template:Nbt: The item's data value, or damage value for tools.
- Template:Nbt: The number of this item in the stack. Range -128 to 127. Values less than 2 are not displayed in-game.
- Template:Nbt An item stack.
- Template:Nbt A tile entity.
- Template:Nbt: Information about the level.
Calculating "Pos" tag of the tile entity:
pos = x + (y << 10) + (z << 20)
Calculating X, Y, and Z from "Pos" tag:
x = pos % 1024
y = (pos >> 10) % 1024
z = (pos >> 20) % 1024
Blocks
The block byte array is used to define the types of blocks that occupy a map. The number of bytes in the array may be calculated by multiplying the dimensions of the map. Y being the up direction rather than Z. For hex values see Block IDs.
To access a specific block from either the block or data array from XYZ coordinates, use the following formula:
<math>array index = (y * length + z) * width + x</math>
Data
The data byte array is used for lighting and extra block data.
For extended information on block metadata, refer to Minecraft:Java Edition data value/Indev.
Lighting
There are 16 levels of lighting for a block ranging from 0x0 (0, no light) to 0xF (15, full light).
External links
Template:Navbox Java Edition technical
Minecraft:de:Spielstand-Speicherung/Indev Level Format Minecraft:fr:Format de niveau de l'édition Java Indev Minecraft:ja:Levelフォーマット/Java Edition Indev Minecraft:nl:Indev level formaat Minecraft:pt:Formato de nível da Edição Java Indev Minecraft:ru:Формат файлов Minecraft (NBT) Minecraft:zh:Indev世界格式