Map item format

From Minecraft Wiki
(Redirected from Map Item Format)
Jump to: navigation, search
This article may need cleanup to comply with the style guide.
Please help improve this if you can. The talk page may contain suggestions.

Minecraft Beta 1.6 added craftable map items. Unlike books, 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 or The End, maps render as a kind of static, making them unreadable.

Data folder structure[edit | edit source]

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 | edit source]

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

NBT structure[edit | edit source]


  • The root tag.

    •  data: The map data.

      •  scale: How zoomed in the map is (it is in 2scale 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.

      •  height: Height of map. Default (and only possible value) 128

      •  width: Width of map. Default (and only possible value) 128

      •  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.

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

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

      •  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 | edit source]

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

NBT structure[edit | edit source]


  • The root tag.

    •  map: Latest map ID.

Color table[edit | edit source]

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

Base colors[edit | edit source]

Blocks are colored according to their material. Each material has a base color which is multiplied by 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 Description
0 Transparent Glass, Powered Rail, Detector Rail, Torch, Redstone Wire, Ladders, Rails, Lever, Redstone Torch, Buttons, Tripwire Hook, Nether Portal (block), Cake, Redstone Repeater, Redstone Comparator, Glass Pane, Flower Pot, Redstone Lamp, Barrier, Mob heads, End Rod, Structure Void, Air, unexplored areas
1 127, 178, 56 Grass Block, Slime Block
2 247, 233, 163 Sand, Sandstone, Sandstone Stairs, Sandstone Slab, Chiseled Sandstone, Smooth Sandstone, Glowstone, End Stone, Birch Wood, Birch Wood Planks, Birch Fence, Birch Fence Gate, Birch Wood Stairs, Birch Wood Slab, Stem and all-sided-inside-textured huge mushroom blocks
3 199, 199, 199 Bed, Cobweb, All-sided-stem huge mushroom blocks
4 255, 0, 0 Lava, TNT, Fire, Block of Redstone
5 160, 160, 255 Ice, Frosted Ice, Packed Ice
6 167, 167, 167 Block of Iron, Iron Door, Iron Trapdoor, Iron Bars, Brewing Stand, Anvil, Weighted Pressure Plate (Heavy)
7 0, 124, 0 Saplings, Leaves, Tall Grass, Dead Bush, Flowers, Mushrooms, Seeds, Cactus, Sugar Cane, Pumpkin Stem, Melon Stem, Vines, Lily Pad
8 255, 255, 255 Wool (White), Carpet (White), White Stained Clay, Snow, Snow block
9 164, 168, 184 Clay Block, Monster Eggs
10 151, 109, 77 Dirt, Granite, Polished Granite, Farmland, Red Sand, Red Sandstone, Red Sandstone Stairs, Red Sandstone Slab, Chiseled Red Sandstone, Smooth Red Sandstone, Jungle Wood, Jungle Wood Planks, Jungle Fence, Jungle Fence Gate, Jungle Wood Stairs, Jungle Wood Slab
11 112, 112, 112 Stone, Stone Slab, Cobblestone, Cobblestone Stairs, Cobblestone Slab, Cobblestone Wall, Moss Stone, Mossy Cobblestone Wall, Andesite, Polished Andesite, Bedrock, Gold Ore, Iron Ore, Coal Ore, Lapis Lazuli Ore, Dispenser, Dropper, Sticky Piston, Piston, Piston Head, Block moved by Piston, Monster Spawner, Diamond Ore, Furnace, Cobblestone Stairs, Stone Pressure Plate, Redstone Ore, Stone Bricks, Stone Brick Stairs, Stone Bricks Slab, Mossy Stone Bricks, Cracked Stone Bricks, Chiseled Stone Bricks, Ender Chest, Hopper, Gravel, Observer, Bone Block
12 64, 64, 255 Water
13 143, 119, 72 Oak Wood, Oak Wood Planks, Oak Fence, Oak Fence Gate, Oak Wood Stairs, Oak Wood Slab, Note Block, Bookshelf, Chest, Trapped Chest, Crafting Table, Wooden Doors, Sign, Wooden Pressure Plate, Jukebox, Wooden Trapdoor, Huge Brown Mushroom, Banners, Daylight Sensor
14 255, 252, 245 Block of Quartz, Quartz Slab, Quartz Stairs, Chiseled Quartz Block, Pillar Quartz Block, Diorite, Polished Diorite, Sea Lantern
15 216, 127, 51 Orange Wool, Orange Carpet, Orange Stained Clay, Pumpkin, Jack-O-Lantern, Hardened Clay, Acacia Wood, Acacia Wood Planks, Acacia Fence, Acacia Fence Gate, Acacia Wood Stairs, Acacia Wood Slab
16 178, 76, 216 Magenta Wool, Magenta Carpet, Magenta Stained Clay
17 102, 153, 216 Light Blue Wool, Light Blue Carpet, Light Blue Stained Clay
18 229, 229, 51 Yellow Wool, Yellow Carpet, Yellow Stained Clay, Hay Bale, Sponge, Wet Sponge
19 127, 204, 25 Lime Wool, Lime Carpet, Lime Stained Clay, Melon
20 242, 127, 165 Pink Wool, Pink Carpet, Pink Stained Clay
21 76, 76, 76 Gray Wool, Gray Carpet, Gray Stained Clay, Cauldron
22 153, 153, 153 Light Gray Wool, Light Gray Carpet, Light Gray Stained Clay, Structure Block
23 76, 127, 153 Cyan Wool, Cyan Carpet, Cyan Stained Clay, Prismarine
24 127, 63, 178 Purple Wool, Purple Carpet, Purple Stained Clay, Mycelium, Command Block (repeating)
25 51, 76, 178 Blue Wool, Blue Carpet, Blue Stained Clay
26 102, 76, 51 Brown Wool, Brown Carpet, Brown Stained Clay, Soul Sand, Dark Oak Wood, Dark Oak Wood Planks, Dark Oak Fence, Dark Oak Fence Gate, Dark Oak Wood Stairs, Dark Oak Wood Slab, Command Block (impulse)
27 102, 127, 51 Green Wool, Green Carpet, Green Stained Clay, End Portal Frame, Command Block (chain)
28 153, 51, 51 Red Wool, Red Carpet, Red Stained Clay, Huge Red Mushroom, Bricks, Brick Stairs, Bricks Slab, Enchanting Table, Nether Wart, Nether Wart Block
29 25, 25, 25 Black Wool, Black Carpet, Black Stained Clay, Dragon Egg, Block of Coal, Obsidian, End Portal (block)
30 250, 238, 77 Block of Gold, Weighted Pressure Plate (Light)
31 92, 219, 213 Block of Diamond, Prismarine Bricks, Dark Prismarine, Beacon
32 74, 128, 255 Lapis Lazuli Block
33 0, 217, 58 Block of Emerald
34 129, 86, 49 Podzol, Spruce Wood, Spruce Wood Planks, Spruce Fence, Spruce Fence Gate, Spruce Wood Stairs, Spruce Wood Slab
35 112, 2, 0 Netherrack, Nether Quartz Ore, Nether Brick, Nether Brick Fence, Nether Brick Stairs, Red Nether Brick, Magma Block

Map colors[edit | edit source]

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 to the nearest whole. 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 | edit source]

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 36 colors to work with and is a lot easier to create an image. With the staircase, you have 108 colors 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 then the block north of it, or topside of the map, you can create a brighter or darker shade then the normal flat color.

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

1.8.1 Color Table[edit | edit source]

Here is the latest color table. Older versions will be below based on the major updates.

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.

Color Table
ID Color RGB Description
0 Transparent Not explored
1 Transparent Not explored
2 Transparent Not explored
3 Transparent Not explored
4 89,125,39 Grass, Slime Block
5 109,153,48 Grass, Slime Block
6 127,178,56 Grass, Slime Block
7 67,94,29 Grass, Slime Block
8 174,164,115 Sand, Sandstone, Birch plank, Glowstone, Endstone
9 213,201,140 Sand, Sandstone, Birch plank, Glowstone, Endstone
10 247,233,163 Sand, Sandstone, Birch plank, Glowstone, Endstone
11 130,123,86 Sand, Sandstone, Birch plank, Glowstone, Endstone
12 138,138,138 Bed, Cobweb
13 169,169,169 Bed, Cobweb
14 197,197,197 Bed, Cobweb
15 104,104,104 Bed, Cobweb
16 180,0,0 Lava, TNT, Redstone Block
17 220,0,0 Lava, TNT, Redstone Block
18 255,0,0 Lava, TNT, Redstone Block
19 135,0,0 Lava, TNT, Redstone Block
20 112,112,180 Ice, Packed Ice
21 138,138,220 Ice, Packed Ice
22 160,160,255 Ice, Packed Ice
23 84,84,135 Ice, Packed Ice
24 117,117,117 Iron Block, Iron items, Brewing Stand
25 144,144,144 Iron Block, Iron items, Brewing Stand
26 167,167,167 Iron Block, Iron items, Brewing Stand
27 88,88,88 Iron Block, Iron items, Brewing Stand
28 0,87,0 Leaves, Flowers, Grass
29 0,106,0 Leaves, Flowers, Grass
30 0,124,0 Leaves, Flowers, Grass
31 0,65,0 Leaves, Flowers, Grass
32 180,180,180 Wool, Snow
33 220,220,220 Wool, Snow
34 255,255,255 Wool, Snow
35 135,135,135 Wool, Snow
36 115,118,129 Clay
37 141,144,158 Clay
38 164,168,184 Clay
39 86,88,97 Clay
40 129,74,33 Dirt, Coarse Dirt, Jungle Plank, Granite
41 157,91,40 Dirt, Coarse Dirt, Jungle Plank, Granite
42 183,106,47 Dirt, Coarse Dirt, Jungle Plank, Granite
43 96,56,24 Dirt, Coarse Dirt, Jungle Plank, Granite
44 79,79,79 Stone, Cobblestone, Ores, Acacia Log, *Many others*
45 96,96,96 Stone, Cobblestone, Ores, Acacia Log, *Many others*
46 112,112,112 Stone, Cobblestone, Ores, Acacia Log, *Many others*
47 59,59,59 Stone, Cobblestone, Ores, Acacia Log, *Many others*
48 101,84,51 Oak Plank, Wooden Items, Mushroom (block), Banners, Daylight Sensor
49 123,103,62 Oak Plank, Wooden Items, Mushroom (block), Banners, Daylight Sensor
50 143,119,72 Oak Plank, Wooden Items, Mushroom (block), Banners, Daylight Sensor
51 76,63,38 Oak Plank, Wooden Items, Mushroom (block), Banners, Daylight Sensor
52 45,45,180 Water
53 55,55,220 Water
54 64,64,255 Water
55 33,33,135 Water
56 180,177,172 Quartz, Sea Lantern, Birch Log
57 220,217,211 Quartz, Sea Lantern, Birch Log
58 255,252,245 Quartz, Sea Lantern, Birch Log
59 135,133,129 Quartz, Sea Lantern, Birch Log
60 152,89,36 Orange Wool/Glass/Stained Clay, Pumpkin, Hardened Clay, Acacia Plank
61 186,109,44 Orange Wool/Glass/Stained Clay, Pumpkin, Hardened Clay, Acacia Plank
62 216,127,51 Orange Wool/Glass/Stained Clay, Pumpkin, Hardened Clay, Acacia Plank
63 114,67,27 Orange Wool/Glass/Stained Clay, Pumpkin, Hardened Clay, Acacia Plank
64 125,53,152 Magenta Wool/Glass/Stained Clay
65 153,65,186 Magenta Wool/Glass/Stained Clay
66 178,76,216 Magenta Wool/Glass/Stained Clay
67 94,40,114 Magenta Wool/Glass/Stained Clay
68 72,108,152 Light Blue Wool/Glass/Stained Clay
69 88,132,186 Light Blue Wool/Glass/Stained Clay
70 102,153,216 Light Blue Wool/Glass/Stained Clay
71 54,81,114 Light Blue Wool/Glass/Stained Clay
72 161,161,36 Yellow Wool/Glass/Stained Clay, Sponge, Hay Bale
73 197,197,44 Yellow Wool/Glass/Stained Clay, Sponge, Hay Bale
74 229,229,51 Yellow Wool/Glass/Stained Clay, Sponge, Hay Bale
75 121,121,27 Yellow Wool/Glass/Stained Clay, Sponge, Hay Bale
76 89,144,17 Lime Wool/Glass/Stained Clay, Melon
77 109,176,21 Lime Wool/Glass/Stained Clay, Melon
78 127,204,25 Lime Wool/Glass/Stained Clay, Melon
79 67,108,13 Lime Wool/Glass/Stained Clay, Melon
80 170,89,116 Pink Wool/Glass/Stained Clay
81 208,109,142 Pink Wool/Glass/Stained Clay
82 242,127,165 Pink Wool/Glass/Stained Clay
83 128,67,87 Pink Wool/Glass/Stained Clay
84 53,53,53 Grey Wool/Glass/Stained Clay
85 65,65,65 Grey Wool/Glass/Stained Clay
86 76,76,76 Grey Wool/Glass/Stained Clay
87 40,40,40 Grey Wool/Glass/Stained Clay
88 108,108,108 Light Grey Wool/Glass/Stained Clay
89 132,132,132 Light Grey Wool/Glass/Stained Clay
90 153,153,153 Light Grey Wool/Glass/Stained Clay
91 81,81,81 Light Grey Wool/Glass/Stained Clay
92 53,89,108 Cyan Wool/Glass/Stained Clay
93 65,109,132 Cyan Wool/Glass/Stained Clay
94 76,127,153 Cyan Wool/Glass/Stained Clay
95 40,67,81 Cyan Wool/Glass/Stained Clay
96 89,44,125 Purple Wool/Glass/Stained Clay, Mycelium
97 109,54,153 Purple Wool/Glass/Stained Clay, Mycelium
98 127,63,178 Purple Wool/Glass/Stained Clay, Mycelium
99 67,33,94 Purple Wool/Glass/Stained Clay, Mycelium
100 36,53,125 Blue Wool/Glass/Stained Clay
101 44,65,153 Blue Wool/Glass/Stained Clay
102 51,76,178 Blue Wool/Glass/Stained Clay
103 27,40,94 Blue Wool/Glass/Stained Clay
104 72,53,36 Brown Wool/Glass/Stained Clay, Soul Sand, Dark Oak Plank
105 88,65,44 Brown Wool/Glass/Stained Clay, Soul Sand, Dark Oak Plank
106 102,76,51 Brown Wool/Glass/Stained Clay, Soul Sand, Dark Oak Plank
107 54,40,27 Brown Wool/Glass/Stained Clay, Soul Sand, Dark Oak Plank
108 72,89,36 Green Wool/Glass/Stained Clay, End Portal Frame
109 88,109,44 Green Wool/Glass/Stained Clay, End Portal Frame
110 102,127,51 Green Wool/Glass/Stained Clay, End Portal Frame
111 54,67,27 Green Wool/Glass/Stained Clay, End Portal Frame
112 108,36,36 Red Wool/Glass/Stained Clay, Huge Red Mushroom, Brick, Enchanting Table
113 132,44,44 Red Wool/Glass/Stained Clay, Huge Red Mushroom, Brick, Enchanting Table
114 153,51,51 Red Wool/Glass/Stained Clay, Huge Red Mushroom, Brick, Enchanting Table
115 81,27,27 Red Wool/Glass/Stained Clay, Huge Red Mushroom, Brick, Enchanting Table
116 17,17,17 Black Wool/Glass/Stained Clay, Dragon Egg, Block of Coal, Obsidian
117 21,21,21 Black Wool/Glass/Stained Clay, Dragon Egg, Block of Coal, Obsidian
118 25,25,25 Black Wool/Glass/Stained Clay, Dragon Egg, Block of Coal, Obsidian
119 13,13,13 Black Wool/Glass/Stained Clay, Dragon Egg, Block of Coal, Obsidian
120 176,168,54 Block of Gold, Weighted Pressure Plate (Light)
121 215,205,66 Block of Gold, Weighted Pressure Plate (Light)
122 250,238,77 Block of Gold, Weighted Pressure Plate (Light)
123 132,126,40 Block of Gold, Weighted Pressure Plate (Light)
124 64,154,150 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
125 79,188,183 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
126 92,219,213 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
127 48,115,112 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
128 52,90,180 Lapis Lazuli Block
129 63,110,220 Lapis Lazuli Block
130 74,128,255 Lapis Lazuli Block
131 39,67,135 Lapis Lazuli Block
132 0,153,40 Block of Emerald
133 0,187,50 Block of Emerald
134 0,217,58 Block of Emerald
135 0,114,30 Block of Emerald
136 90,59,34 Podzol, Spruce Plank
137 110,73,41 Podzol, Spruce Plank
138 127,85,48 Podzol, Spruce Plank
139 67,44,25 Podzol, Spruce Plank
140 79,1,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items
141 96,1,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items
142 112,2,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items
143 59,1,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items

1.7.2 Color Table[edit | edit source]

Original Color Table[edit | edit source]

Code examples[edit | edit source]


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

References[edit | edit source]

  1. http://twitter.com/notch/status/62970142207913984
  2. http://twitter.com/notch/status/65360048049754112