Indev level format

From Minecraft Wiki
Jump to: navigation, search

The .mclevel map format is an old map format, created by Notch. It is based on the NBT Format.

The map format is in use since indev version 0.31.

While Alpha (and Infdev) levels use NBT files, they have a very different file format.

For details on the infinite map format, see Alpha Level Format.

Contents

[edit] NBT Structure

  • Nbtsheet.png MinecraftLevel: The root tag.
    • Nbtsheet.png About: Information about the level.
      • Nbtsheet.png CreatedOn: The Unix time when the level was created.
      • Nbtsheet.png Name: The name of the level, always "A Nice World".
      • Nbtsheet.png Author: The name of the user who created the level.
    • Nbtsheet.png Environment: Information about the environment of the level, which varies based on the map generation settings.
      • Nbtsheet.png TimeOfDay: The number of ticks since the start of the level. Affects the day/night cycle.
      • Nbtsheet.png SkyBrightness: The sky light level, 0 to 15.
      • Nbtsheet.png SkyColor: The color of the sky.
      • Nbtsheet.png FogColor: The color of the fog.
      • Nbtsheet.png CloudColor: The color of the clouds.
      • Nbtsheet.png CloudHeight: The height of the clouds (Y coordinate).
      • Nbtsheet.png SurroundingGroundType: The Block ID of the "surrounding ground".
      • Nbtsheet.png SurroundingGroundHeight: The height of the "surrounding ground".
      • Nbtsheet.png SurroundingWaterType: The Block ID of the "surrounding water".
      • Nbtsheet.png SurroundingWaterHeight: The height of the "surrounding water".
    • Nbtsheet.png Map: The actual map data.
      • Nbtsheet.png Width: The width of the level.
      • Nbtsheet.png Length: The length of the level.
      • Nbtsheet.png Height: The height of the level.
      • Nbtsheet.png Spawn: List of 3 TAG_Shorts for the X, Y, and Z spawn coordinates.
      • Nbtsheet.png Blocks: Width*Length*Height bytes of Block IDs.
      • Nbtsheet.png Data: Width*Length*Height bytes of Block Data and Lighting.
    • Nbtsheet.png Entities: List of TAG_Compounds for the entities in the level.
      • Nbtsheet.png An entity. See Chunk format -> Entity Format. Not all information is relevant to Minecraft Indev. The player has its own entity, shown below as an example.
        • Nbtsheet.png id: The entity ID. In this case, "LocalPlayer".
        • Nbtsheet.png Pos: List of 3 TAG_Doubles for the X, Y, and Z position of the player.
        • Nbtsheet.png Rotation: List of 2 TAG_Floats for the Yaw and Pitch of the player's view.
        • Nbtsheet.png Motion: List of 3 TAG_Doubles for the X, Y, and Z motion in meters per tick.
        • Nbtsheet.png FallDistance: How far the player has fallen.
        • Nbtsheet.png Health: The number of hit points the player has. 20 is 10 hearts.
        • Nbtsheet.png AttackTime: Number of ticks the player is immune to attacks.
        • Nbtsheet.png HurtTime: Number of ticks the player is red from being attacked.
        • Nbtsheet.png DeathTime: Number of ticks the player has been dead for - used for controlling the death animation.
        • Nbtsheet.png Air: The number of ticks before the player starts to drown. Starts at 300.
        • Nbtsheet.png Fire: When negative, the number of ticks before the player can catch on fire. When positive, the number of ticks before the fire is extinguished.
        • Nbtsheet.png Score: The player's score.
        • Nbtsheet.png Inventory: List of TAG_Compounds representing the items in the player's inventory.
          • Nbtsheet.png An inventory item.
            • Nbtsheet.png Slot: The Slot the item is in.
            • Nbtsheet.png id: The Item ID.
            • Nbtsheet.png Damage: The item's data value, or damage value for tools.
            • Nbtsheet.png Count: The number of this item in the stack. Range -128 to 127. Values less than 2 are not displayed in-game.
    • Nbtsheet.png TileEntities: List of TAG_Compounds for the tile entities in the level.
      • Nbtsheet.png A tile entity.
        • See Chunk format -> Tile Entity Format. Not all information is relevant to Minecraft Indev.
        • Nbtsheet.png Pos: Position of the tile entity. X coordinate is Pos % 1024, Y is (Pos >> 10) % 1024, Z is (Pos >> 20) % 1024.

[edit] 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:

Index = x + (y * Height + z) * Width

[edit] Data

The Data byte array is used for lighting and extra block data. The first 4 bit contains the extra block data (also known as metadata) and the other 4 bits the lighting.

For extended information on block metadata, refer to Data values.

[edit] Lighting

Lighting values.png

There are 16 levels of lighting for a block ranging from 0x0 (no light) to 0xF (full light).

Personal tools
Namespaces
Variants
Actions
Minecraft Wiki
Minecraft
Useful pages
Toolbox
In other languages

Recent Community Articles

Mojang Tweets

    Getting your tweets...
Become a Premium Member!