Share

Share

Map item format

From Minecraft Wiki
(Redirected from Map Item Format)
Jump to: navigation, search

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]

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

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

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 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, Fire, Redstone Wire, Ladders, Rails, Lever, Redstone Torch, Buttons, Tripwire Hook, Portal, Cake, Redstone Repeater, Redstone Comparator, Glass Pane, End Portal, Flower Pot, Redstone Lamp, Barrier, Mob heads, Air, unexplored areas
1 125,176,55 Grass Block, Slime Block
2 244,230,161 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
3 197,197,197 Bed, Cobweb, All-sided stem-textured huge mushroom blocks
4 252,0,0 Lava, TNT, Block of Redstone
5 158,158,252 Ice, Packed Ice
6 165,165,165 Block of Iron, Iron Door, Iron Trapdoor, Iron Bars, Brewing Stand, Anvil, Weighted Pressure Plate (Heavy)
7 0,123,0 Saplings, Leaves, Tall Grass, Dead Bush, Flowers, Mushrooms, Seeds, Cactus, Sugar Cane, Pumpkin Stem, Melon Stem, Vines, Lily Pad
8 252,252,252 Block of Quartz, Quartz Slab, Quartz Stairs, Chiseled Quartz Block, Pillar Quartz Block, Diorite, Polished Diorite, Sea Lantern
9 162,166,182 Clay Block, Monster Eggs
10 149,108,76 Dirt, Granite, Polished Granite, Farmland, Red Sand, Red Sandstone, Red Sandstone Stairs, Red Sandstone Slab, Chiseled Red Sandstone, Smooth Red Sandstone, Command Block, Jungle Wood, Jungle Wood Planks, Jungle Fence, Jungle Fence Gate, Jungle Wood Stairs, Jungle Wood Slab
11 111,111,111 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 Extension, 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
12 63,63,252 Water
13 141,118,71 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 252,249,242 Wool (White), Carpet (White), White Stained Clay, Snow, Snow block
15 213,125,50 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 176,75,213 Magenta Wool, Magenta Carpet, Magenta Stained Clay
17 101,151,213 Light Blue Wool, Light Blue Carpet, Light Blue Stained Clay
18 226,226,50 Yellow Wool, Yellow Carpet, Yellow Stained Clay, Hay Bale, Sponge, Wet Sponge
19 125,202,25 Lime Wool, Lime Carpet, Lime Stained Clay, Melon
20 239,125,163 Pink Wool, Pink Carpet, Pink Stained Clay
21 75,75,75 Gray Wool, Gray Carpet, Gray Stained Clay, Cauldron
22 151,151,151 Light Gray Wool, Light Gray Carpet, Light Gray Stained Clay
23 75,125,151 Cyan Wool, Cyan Carpet, Cyan Stained Clay, Prismarine
24 125,62,176 Purple Wool, Purple Carpet, Purple Stained Clay, Mycelium
25 50,75,176 Blue Wool, Blue Carpet, Blue Stained Clay
26 101,75,50 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
27 101,125,50 Green Wool, Green Carpet, Green Stained Clay, End Portal (frame)
28 151,50,50 Red Wool, Red Carpet, Red Stained Clay, Huge Red Mushroom, Bricks, Brick Stairs, Bricks Slab
29 25,25,25 Black Wool, Black Carpet, Black Stained Clay, Dragon Egg, Block of Coal
30 247,235,76 Block of Gold, Weighted Pressure Plate (Light)
31 91,216,210 Block of Diamond, Prismarine Bricks, Dark Prismarine, Beacon
32 73,129,252 Lapis Lazuli Block
33 0,214,57 Block of Emerald
34 127,85,48
35 111,2,0 Netherrack, Nether Quartz Ore, Nether Wart, Nether Brick, Nether Brick Fence, Nether Brick Stairs
126,84,48 Podzol, Spruce Wood, Spruce Wood Planks, Spruce Fence, Spruce Fence Gate, Spruce Wood Stairs, Spruce Wood Slab

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

Here is the color table for 1.8.1. The full 1.8.0 table is at the bottom

Color Table
ID Color RGB Description
0 Transparent Not explored
1 Transparent Not explored
2 Transparent Not explored
3 Transparent Not explored
4 88,124,39 Grass
5 108,151,47 Grass
6 125,176,55 Grass
7 66,93,29 Grass
8 172,162,114 Sand/Gravel
9 210,199,138 Sand/Gravel
10 244,230,161 Sand/Gravel
11 128,122,85 Sand/Gravel
12 138,138,138 Other
13 169,169,169 Other
14 197,197,197 Other
15 104,104,104 Other
16 178,0,0 Lava/TNT
17 217,0,0 Lava/TNT
18 252,0,0 Lava/TNT
19 133,0,0 Lava/TNT
20 111,111,178 Ice/Packed Ice
21 136,136,217 Ice/Packed Ice
22 158,158,252 Ice/Packed Ice
23 83,83,133 Ice/Packed Ice
24 116,116,116 Metal
25 142,142,142 Metal
26 165,165,165 Metal
27 87,87,87 Metal
28 0,86,0 Plants
29 0,105,0 Plants
30 0,123,0 Plants
31 0,64,0 Plants
32 178,178,178 Snow
33 217,217,217 Snow
34 252,252,252 Snow
35 133,133,133 Snow
36 114,117,127 Clay
37 139,142,156 Clay
38 162,166,182 Clay
39 85,87,96 Clay
40 105,75,53 Dirt
41 128,93,65 Dirt
42 149,108,76 Dirt
43 78,56,39 Dirt
44 78,78,78 Stone/Cobblestone/Ore
45 95,95,95 Stone/Cobblestone/Ore
46 111,111,111 Stone/Cobblestone/Ore
47 58,58,58 Stone/Cobblestone/Ore
48 44,44,178 Water
49 54,54,217 Water
50 63,63,252 Water
51 33,33,133 Water
52 99,83,49 Log/Tree/Wood
53 122,101,61 Log/Tree/Wood
54 141,118,71 Log/Tree/Wood
55 74,62,38 Log/Tree/Wood
56 178,175,170 White Wool/Carpet/Stained Clay
57 217,214,208 White Wool/Carpet/Stained Clay
58 252,249,242 White Wool/Carpet/Stained Clay
59 133,131,127 White Wool/Carpet/Stained Clay
60 150,88,36 Orange Wool/Carpet/Stained Clay, Pumpkin, Hardened Clay, Acacia Items
61 184,108,43 Orange Wool/Carpet/Stained Clay, Pumpkin, Hardened Clay, Acacia Items
62 213,125,50 Orange Wool/Carpet/Stained Clay, Pumpkin, Hardened Clay, Acacia Items
63 113,66,27 Orange Wool/Carpet/Stained Clay, Pumpkin, Hardened Clay, Acacia Items
64 124,52,150 Magenta Wool/Carpet/Stained Clay
65 151,64,184 Magenta Wool/Carpet/Stained Clay
66 176,75,213 Magenta Wool/Carpet/Stained Clay
67 93,39,113 Magenta Wool/Carpet/Stained Clay
68 71,107,150 Light Blue Wool/Carpet/Stained Clay
69 87,130,184 Light Blue Wool/Carpet/Stained Clay
70 101,151,213 Light Blue Wool/Carpet/Stained Clay
71 53,80,113 Light Blue Wool/Carpet/Stained Clay
72 159,159,36 Yellow Wool/Carpet/Stained Clay, Sponge
73 195,195,43 Yellow Wool/Carpet/Stained Clay, Sponge
74 226,226,50 Yellow Wool/Carpet/Stained Clay, Sponge
75 120,120,27 Yellow Wool/Carpet/Stained Clay, Sponge
76 88,142,17 Lime Wool/Carpet/Stained Clay, Melon
77 108,174,21 Lime Wool/Carpet/Stained Clay, Melon
78 125,202,25 Lime Wool/Carpet/Stained Clay, Melon
79 66,107,13 Lime Wool/Carpet/Stained Clay, Melon
80 168,88,115 Pink Wool/Carpet/Stained Clay
81 206,108,140 Pink Wool/Carpet/Stained Clay
82 239,125,163 Pink Wool/Carpet/Stained Clay
83 126,66,86 Pink Wool/Carpet/Stained Clay
84 52,52,52 Grey Wool/Carpet/Stained Clay, Cauldron
85 64,64,64 Grey Wool/Carpet/Stained Clay, Cauldron
86 75,75,75 Grey Wool/Carpet/Stained Clay, Cauldron
87 39,39,39 Grey Wool/Carpet/Stained Clay, Cauldron
88 107,107,107 Light Grey Wool/Carpet/Stained Clay
89 130,130,130 Light Grey Wool/Carpet/Stained Clay
90 151,151,151 Light Grey Wool/Carpet/Stained Clay
91 80,80,80 Light Grey Wool/Carpet/Stained Clay
92 52,88,107 Cyan Wool/Carpet/Stained Clay
93 64,108,130 Cyan Wool/Carpet/Stained Clay
94 75,125,151 Cyan Wool/Carpet/Stained Clay
95 39,66,80 Cyan Wool/Carpet/Stained Clay
96 88,43,124 Purple Wool/Carpet/Stained Clay, Mycelium
97 108,53,151 Purple Wool/Carpet/Stained Clay, Mycelium
98 125,62,176 Purple Wool/Carpet/Stained Clay, Mycelium
99 66,33,93 Purple Wool/Carpet/Stained Clay, Mycelium
100 36,52,124 Blue Wool/Carpet/Stained Clay
101 43,64,151 Blue Wool/Carpet/Stained Clay
102 50,75,176 Blue Wool/Carpet/Stained Clay
103 27,39,93 Blue Wool/Carpet/Stained Clay
104 71,52,36 Brown Wool/Carpet/Stained Clay, Soul Sand, Dark Oak Items
105 87,64,43 Brown Wool/Carpet/Stained Clay, Soul Sand, Dark Oak Items
106 101,75,50 Brown Wool/Carpet/Stained Clay, Soul Sand, Dark Oak Items
107 53,39,27 Brown Wool/Carpet/Stained Clay, Soul Sand, Dark Oak Items
108 71,88,36 Green Wool/Carpet/Stained Clay, End Portal Frame
109 87,108,43 Green Wool/Carpet/Stained Clay, End Portal Frame
110 101,125,50 Green Wool/Carpet/Stained Clay, End Portal Frame
111 53,66,27 Green Wool/Carpet/Stained Clay, End Portal Frame
112 107,36,36 Red Wool/Carpet/Stained Clay, Huge Red Mushroom, Brick Items
113 130,43,43 Red Wool/Carpet/Stained Clay, Huge Red Mushroom, Brick Items
114 151,50,50 Red Wool/Carpet/Stained Clay, Huge Red Mushroom, Brick Items
115 80,27,27 Red Wool/Carpet/Stained Clay, Huge Red Mushroom, Brick Items
116 17,17,17 Black Wool/Carpet/Stained Clay, Dragon Egg, Block of Coal
117 21,21,21 Black Wool/Carpet/Stained Clay, Dragon Egg, Block of Coal
118 25,25,25 Black Wool/Carpet/Stained Clay, Dragon Egg, Block of Coal
119 13,13,13 Black Wool/Carpet/Stained Clay, Dragon Egg, Block of Coal
120 174,166,53 Block of Gold, Hay Bale, Weighted Pressure Plate (Light)
121 212,203,65 Block of Gold, Hay Bale, Weighted Pressure Plate (Light)
122 247,235,76 Block of Gold, Hay Bale, Weighted Pressure Plate (Light)
123 130,125,39 Block of Gold, Hay Bale, Weighted Pressure Plate (Light)
124 63,152,148 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
125 78,186,181 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
126 91,216,210 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
127 47,114,111 Block of Diamond, Prismarine, Prismarine Bricks, Dark Prismarine, Beacon
128 51,89,178 Lapis Lazuli Block
129 62,109,217 Lapis Lazuli Block
130 73,129,252 Lapis Lazuli Block
131 39,66,133 Lapis Lazuli Block
132 0,151,39 Block of Emerald
133 0,185,49 Block of Emerald
134 0,214,57 Block of Emerald
135 0,113,30 Block of Emerald
136 90,59,34 Obsidian, Enchantment Table, End Portal (portal)
137 110,73,41 Obsidian, Enchantment Table, End Portal (portal)
138 127,85,48 Obsidian, Enchantment Table, End Portal (portal)
139 67,44,25 Obsidian, Enchantment Table, End Portal (portal)
140 78,1,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items
141 95,1,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items
142 111,2,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items
143 58,1,0 Netherrack, Quartz Ore, Nether Wart, Nether Brick Items

1.8 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

References[edit]