Map item format

From Minecraft Wiki
Jump to: navigation, search
Cleanup.svg
This article may need cleanup to comply with the style guide. Discuss
Please help us clean up this page if you can. The talk page may contain suggestions.
Java Edition.png

Maps do not store their information in the item - instead, their data value corresponds to the map number (ID) of a saved file. Their information is placed in the "data" directory within the world's save directory. Each map has its own file associated with its ID, and there is one file that keeps track of the highest (= most recently created) map ID. This is limited to the size of a short (32,768).[1] When Notch was adding them the first time he did not use the NBT format.[2]

When used in the Nether, maps render as a kind of static, making them unreadable.

Data folder structure[edit]

The file idcounts.dat contains the latest ID for current map. Each map's file name uses the format map_<#>.dat, where <#> is the map's unique number.

map_<#>.dat format[edit]

map_<#>.dat files are GZip'd NBT files.

NBT structure[edit]


  • The root tag.

    •  data: The map data.

      •  scale: How zoomed in the map is (it is in 2scale wide blocks square per pixel, even for 0, where the map will be 1:1). Default 3, minimum 0 and maximum 4.

      •  dimension: 0 = The Overworld, -1 = The Nether, 1 = The End, any other value = map is a static image with no player pin.

      •  trackingPosition: 1 (default) indicates that a positional arrow should be shown when the map is near its center coords. 0 indicates that the position arrow should never be shown.

      •  unlimitedTracking: 1 (default) allows the player position indicator to show as a smaller dot on the map's edge when the player is farther than 320 * (scale+1) blocks from the map's center. 0 will make the dot instead disappear when the player is farther than this distance.

      •  xCenter: Center of map according to real world by X.

      •  zCenter: Center of map according to real world by Z.

      •  banners: List of banner markers added to this map. May be empty.

        • A banner marker.

          •  Color: The color of the banner. Allowed values: white, orange, magenta, light_blue, yellow, lime, pink, gray, light_gray, cyan, purple, blue, brown, green, red, black.

          •  Name: The custom name of the banner, in JSON text. May not exist.

          •  Pos: The block position of the banner in the world.

            •  X: The x-position of the banner.

            •  Y: The y-position of the banner.

            •  Z: The z-position of the banner.

      •  frames: List map markers added to this map. May be empty.

        • A marker.

          •  EntityId: Arbitrary unique value for the marker.

          •  Rotation: The rotation of the marker, ranging from 0 to 360.

          •  Pos: The block position of the marker in the world.

            •  X: The x-position of the marker.

            •  Y: The y-position of the marker.

            •  Z: The z-position of the marker.

      •  colors: Width * Height array of color values (16384 entries for a default 128x128 map). Color can be accessed via the following method: colorID = Colors[widthOffset + heightOffset * width], where (widthOffset==0, heightOffset==0) is left upper point.

When this structure is loaded, Colors array is transformed to standard dimension (if it's necessary) and then structure is saved with standard height and width.

idcounts.dat format[edit]

This file keeps track of the latest map added. It is stored as a raw (uncompressed) NBT file.

NBT structure[edit]


  • The root tag.

    •  map: Latest map ID.

Color table[edit]

Maps use a color table to store the colors efficiently by ID.

Base colors[edit]

Blocks are colored according to their material. Each material has a base color which is multiplied by 135, 180, 220 or 255, and then divided by 255 to make the map color. Each base color below is associated with four map colors - to get the first map color ID for a base color, multiply the base color ID by 4.

Color Table
ID Color RGB Corresponding Blocks
Non-Transparent Transparent[note 1]
0 AIR Transparent Glass, Glass Pane, Flower Pot, Ladder, Button, Lever, Redstone Repeater, Redstone Comparator, Redstone Dust, Torch, Redstone Torch, Redstone Lamp, Rail, Powered Rail, Detector Rail, Activator Rail, Tripwire, Tripwire Hook, Cake, Mob Head, Nether Portal, End Rod, all Shulker Boxes, Barrier, Structure Void, Air, unexplored areas
1 GRASS 127, 178, 56 Grass Block Slime Block
2 SAND 247, 233, 163 Sand, Sandstone (plain, Smooth, Chiseled, Stairs, Slab), Birch Wood (vertical Log, Planks, Stairs, Slab), Mushroom Block with "pores" texture facing up, Bone Block, Glowstone, End Stone, End Stone Bricks Birch Wood (Door, Fence, Fence Gate)
3 CLOTH 199, 199, 199 Mushroom Block with "stem" texture facing up, Cobweb 1.12 Onwards: Bed head
Before 1.12: Bed head and foot
4 TNT 255, 0, 0 TNT, Block of Redstone, Lava Fire
5 ICE 160, 160, 255 Ice, Frosted Ice, Packed Ice
6 IRON 167, 167, 167 Block of Iron Iron Door, Iron Trapdoor, Iron Bars, Weighted Pressure Plate (Heavy), Anvil, Brewing Stand
7 FOLIAGE 0, 124, 0 Leaves Sapling, Tall Grass, Flower, Lily Pad, Wheat, Carrots, Potatoes, Beetroots, Sugar Canes, Pumpkin Stem, Melon Stem, Cactus, Vines, Cocoa, small red or brown Mushroom
8 SNOW 255, 255, 255 White Wool, Snow Block Snow Layer, White Carpet, White Stained Glass, White Stained Glass Pane
1.12 Onwards: White Bed foot, White Glazed Terracotta, White Concrete, White Concrete Powder
Before 1.12: White Stained Hardened Clay
9 CLAY 164, 168, 184 Clay, Infested Block (Stone, Cobblestone, Stone Brick, Mossy Stone Brick, Cracked Stone Brick, Chiseled Stone Brick)
10 DIRT 151, 109, 77 Jungle Wood (vertical Log, Planks, Stairs, Slab), Brown Mushroom Block with "cap" texture facing up, Dirt, Coarse Dirt, Jukebox, Granite (plain, Polished), Farmland, Grass Path Jungle Wood (Door, Fence, Fence Gate)
11 STONE 112, 112, 112 Cobblestone (block, Stairs, Slab), Stone (block, Slab), Stone Brick (plain, Cracked, Chiseled, Stairs, Slab), Moss Stone, Mossy Stone Bricks, Gravel, Andesite (plain, Polished), Ore (Coal, Iron, Gold, Redstone, Lapis Lazuli, Diamond, Emerald), Bedrock, Furnace, Dispenser, Dropper, Hopper, Observer, horizontal Acacia Log Cobblestone Wall, Mossy Cobblestone Wall, Stone Pressure Plate, Cauldron, Piston and Sticky Piston (base, Head, Extension), Ender Chest, Spawner
12 WATER 64, 64, 255 Water
13 WOOD 143, 119, 72 Oak Wood (vertical Log, Planks, Stairs, Slab), Crafting Table, Bookshelf, Note Block Oak Wood (Door, Fence, Fence Gate), Dead Bush, Wooden Pressure Plate, Wooden Trapdoor, Sign, Chest, Trapped Chest, Banner, Daylight Sensor
14 QUARTZ 255, 252, 245 Horizontal Birch Log, Diorite (plain, Polished), Quartz (Block, Chiseled, Pillar, Stairs, Slab), Sea Lantern
15 ADOBE 216, 127, 51 Acacia Wood (vertical Log, Planks, Stairs, Slab), Orange Wool, Orange Carpet, Pumpkin, Jack o'Lantern, Red Sand, Red Sandstone (plain, Smooth, Chiseled, Stairs, Slab), Terracotta/Hardened Clay
1.12 Onwards: Orange Glazed Terracotta, Orange Concrete, Orange Concrete Powder
Before 1.12: Orange Stained Hardened Clay
Acacia Wood (Door, Fence, Fence Gate), Orange Stained Glass, Orange Stained Glass Pane
1.12 Onwards: Orange Bed foot
16 MAGENTA 178, 76, 216 Purpur (Block, Pillar, Slab), Magenta Wool
1.12 Onwards: Magenta Glazed Terracotta, Magenta Concrete, Magenta Concrete Powder
Before 1.12: Magenta Stained Hardened Clay
Magenta Carpet, Magenta Stained Glass, Magenta Stained Glass Pane
1.12 Onwards: Magenta Bed foot
17 LIGHT_BLUE 102, 153, 216 Light Blue Wool
1.12 Onwards: Light Blue Glazed Terracotta, Light Blue Concrete, Light Blue Concrete Powder
Before 1.12: Light Blue Stained Hardened Clay
Light Blue Carpet, Light Blue Stained Glass, Light Blue Stained Glass Pane
1.12 Onwards: Light Blue Bed foot
18 YELLOW 229, 229, 51 Hay Bale, Sponge, Wet Sponge, Yellow Wool
1.12 Onwards: Yellow Glazed Terracotta, Yellow Concrete, Yellow Concrete Powder
Before 1.12: Yellow Stained Hardened Clay
Yellow Carpet, Yellow Stained Glass, Yellow Stained Glass Pane
1.12 Onwards: Yellow Bed foot
19 LIME 127, 204, 25 Melon, Lime Wool
1.12 Onwards: Lime Glazed Terracotta, Lime Concrete, Lime Concrete Powder
Before 1.12: Lime Stained Hardened Clay
Lime Carpet, Lime Stained Glass, Lime Stained Glass Pane
1.12 Onwards: Lime Bed foot
20 PINK 242, 127, 165 Pink Wool
1.12 Onwards: Pink Glazed Terracotta, Pink Concrete, Pink Concrete Powder
Before 1.12: Pink Stained Hardened Clay
Pink Carpet, Pink Stained Glass, Pink Stained Glass Pane
1.12 Onwards: Pink Bed foot
21 GRAY 76, 76, 76 Gray Wool
1.12 Onwards: Gray Glazed Terracotta, Gray Concrete, Gray Concrete Powder
Before 1.12: Gray Stained Hardened Clay
Gray Carpet, Gray Stained Glass, Gray Stained Glass Pane
1.12 Onwards: Gray Bed foot
22 SILVER 153, 153, 153 Structure Block, Light Gray Wool
1.12 Onwards: Light Gray Glazed Terracotta, Light Gray Concrete, Light Gray Concrete Powder
Before 1.12: Light Gray Stained Hardened Clay
Light Gray Carpet, Light Gray Stained Glass, Light Gray Stained Glass Pane
1.12 Onwards: Light Gray Bed foot
23 CYAN 76, 127, 153 Prismarine, Cyan Wool
1.12 Onwards: Cyan Glazed Terracotta, Cyan Concrete, Cyan Concrete Powder
Before 1.12: Cyan Stained Hardened Clay
Cyan Carpet, Cyan Stained Glass, Cyan Stained Glass Pane
1.12 Onwards: Cyan Bed foot
24 PURPLE 127, 63, 178 Repeating Command Block, Mycelium, Purple Wool
1.12 Onwards: Purple Glazed Terracotta, Purple Concrete, Purple Concrete Powder
Before 1.12: Purple Stained Hardened Clay
Chorus Flower, Chorus Plant, Purple Carpet, Purple Stained Glass, Purple Stained Glass Pane
1.12 Onwards: Purple Bed foot
25 BLUE 51, 76, 178 Blue Wool
1.12 Onwards: Blue Glazed Terracotta, Blue Concrete, Blue Concrete Powder
Before 1.12: Blue Stained Hardened Clay
Blue Carpet, Blue Stained Glass, Blue Stained Glass Pane
1.12 Onwards: Blue Bed foot
26 BROWN 102, 76, 51 Dark Oak Wood (vertical or horizontal Log, Planks, Stairs, Slab), horizontal Spruce Log, Impulse Command Block, Soul Sand, Brown Wool
1.12 Onwards: Brown Glazed Terracotta, Brown Concrete, Brown Concrete Powder
Before 1.12: Brown Stained Hardened Clay
Dark Oak Wood (Door, Fence, Fence Gate), Brown Carpet, Brown Stained Glass, Brown Stained Glass Pane
1.12 Onwards: Brown Bed foot
27 GREEN 102, 127, 51 Chain Command Block, Green Wool
1.12 Onwards: Green Glazed Terracotta, Green Concrete, Green Concrete Powder
Before 1.12: Green Stained Hardened Clay
End Portal Frame, Green Carpet, Green Stained Glass, Green Stained Glass Pane
1.12 Onwards: Green Bed foot
28 RED 153, 51, 51 Bricks (block, Slab, Stairs), Nether Wart Block, Red Wool
1.12 Onwards: Red Glazed Terracotta, Red Concrete, Red Concrete Powder
Before 1.12: Red Stained Hardened Clay, Red Mushroom Block with "cap" texture facing up
Nether Wart, Enchantment Table, Red Carpet, Red Stained Glass, Red Stained Glass Pane
1.12 Onwards: Red Bed foot
29 BLACK 25, 25, 25 Block of Coal, Obsidian, Black Wool
1.12 Onwards: Black Glazed Terracotta, Black Concrete, Black Concrete Powder
Before 1.12: Black Stained Hardened Clay
Dragon Egg, End Gateway, End Portal, Black Carpet, Black Stained Glass, Black Stained Glass Pane
1.12 Onwards: Black Bed foot
30 GOLD 250, 238, 77 Block of Gold Weighted Pressure Plate (Light)
31 DIAMOND 92, 219, 213 Block of Diamond, Prismarine Bricks, Dark Prismarine Beacon
32 LAPIS 74, 128, 255 Lapis Lazuli Block
33 EMERALD 0, 217, 58 Block of Emerald
34 OBSIDIAN 129, 86, 49 Spruce Wood (vertical Log, Planks, Stairs, Slab), horizontal Oak Log, horizontal Jungle Log, Podzol Spruce Wood (Door, Fence, Fence Gate)
35 NETHERRACK 112, 2, 0 Netherrack, Nether Bricks, Nether Brick Stairs, Red Nether Bricks, Nether Quartz Ore, Magma Block Nether Brick Fence
36 WHITE_STAINED_HARDENED_CLAY 209, 177, 161 1.12 Onwards: White Terracotta
37 ORANGE_STAINED_HARDENED_CLAY 159, 82, 36 1.12 Onwards: Orange Terracotta
38 MAGENTA_STAINED_HARDENED_CLAY 149, 87, 108 1.12 Onwards: Magenta Terracotta
39 LIGHT_BLUE_STAINED_HARDENED_CLAY 112, 108, 138 1.12 Onwards: Light Blue Terracotta
40 YELLOW_STAINED_HARDENED_CLAY 186, 133, 36 1.12 Onwards: Yellow Terracotta
41 LIME_STAINED_HARDENED_CLAY 103, 117, 53 1.12 Onwards: Lime Terracotta
42 PINK_STAINED_HARDENED_CLAY 160, 77, 78 1.12 Onwards: Pink Terracotta
43 GRAY_STAINED_HARDENED_CLAY 57, 41, 35 1.12 Onwards: Gray Terracotta
44 SILVER_STAINED_HARDENED_CLAY 135, 107, 98 1.12 Onwards: Light Gray Terracotta
45 CYAN_STAINED_HARDENED_CLAY 87, 92, 92 1.12 Onwards: Cyan Terracotta
46 PURPLE_STAINED_HARDENED_CLAY 122, 73, 88 1.12 Onwards: Purple Terracotta
47 BLUE_STAINED_HARDENED_CLAY 76, 62, 92 1.12 Onwards: Blue Terracotta
48 BROWN_STAINED_HARDENED_CLAY 76, 50, 35 1.12 Onwards: Brown Terracotta
49 GREEN_STAINED_HARDENED_CLAY 76, 82, 42 1.12 Onwards: Green Terracotta
50 RED_STAINED_HARDENED_CLAY 142, 60, 46 1.12 Onwards: Red Terracotta
51 BLACK_STAINED_HARDENED_CLAY 37, 22, 16 1.12 Onwards: Black Terracotta
  1. These blocks only appear on the map as the listed color when a non-transparent block is directly underneath; otherwise, they appear as transparent. For the purposes of this table, "transparent" means with a light-opacity of 0, which excludes partially opaque blocks like cobwebs.

Map colors[edit]

Each base color above has 4 associated map colors below. The conversion works by multiplying each of the red, green, and blue values by a value and then dividing by 255, finally rounding down to a whole number. As of weekly snapshot 13w42b, the fourth base color variant is now multiplied by 135, providing a darker set of colors rather than just a clone of the second base color variant.

Map Color ID Multiply R,G,B By
Base Color ID*4 + 0 180
Base Color ID*4 + 1 220
Base Color ID*4 + 2 255 (same color)
Base Color ID*4 + 3 135

Map Pixel Art[edit]

Redstonehelper uses the staircase method in survival

People have used the map to create pixel art. The default map has an image size of 128x128 and will read each block as a specific color. By placing blocks in a specific arrangement, it is possible to create pixel art images.

Methods for creating map pixel art is either flat, or staircase. With the flat method, you have 51 colors (version 1.12) to work with and is a lot easier to create an image. With the staircase, you have 153 colors (version 1.12) and is a lot more difficult to work with. For the staircase method, blocks are placed at different elevations to obtain the extra 2/3 of the colors. By placing a block higher or lower than the block north of it, or topside of the map, you can create a brighter or darker shade than the normal flat color.

With the flat method, the 2nd shade of each color group on the lists below can be used. For the staircase method, the first 3 shades of the colors groups below can be used. The 4th shade cannot be obtained in traditional gameplay, but with the use of an external tool.

1.12 Color Table[edit]

1.8.1 Color Table[edit]

Note: The description may not list every possible block. Example: In 1.8.1, any block that uses colored wool can also use colored carpet or colored pane glass.

1.7.2 Color Table[edit]

Original Color Table[edit]

Code examples[edit]


This section is a stub. Please help us by expanding it.
Library name Language Link to Map-related code
MCModify Java Map.java
minecraftmap Python __init__.py
mcmapimg Python mcmapimg.py

References[edit]

Promotional Content