Minecraft Wiki
Advertisement
Brush
This article needs cleanup to comply with the style guide. [discuss]
Please help improve this page. 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

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

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

NBT structure

  • 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

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

NBT structure

  • The root tag.
    •  map: Latest map ID.

Color table

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

Base colors

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.

ID Color RGB Blocks
0 Transparent
1 125,176,55
2 244,230,161
3 197,197,197
4 252,0,0
5 158,158,252
6 165,165,165
7 0,123,0
8 252,252,252
9 162,166,182
10 149,108,76
11 111,111,111
12 63,63,252
13 141,118,71
14 252,249,242
15 213,125,50
16 176,75,213
17 101,151,213
18 226,226,50
19 125,202,25
20 239,125,163
21 75,75,75
22 151,151,151
23 75,125,151
24 125,62,176
25 50,75,176
26 101,75,50
27 101,125,50
28 151,50,50
29 25,25,25
30 247,235,76
31 91,216,210
32 73,129,252
33 0,214,57
34 127,85,48
35 111,2,0
36 126,84,48

Map colors

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

ID Color RGB Blocks
0 Transparent
1 Transparent
2 Transparent
3 Transparent
4 88,124,39
5 108,151,47
6 125,176,55
7 66,93,29
8 172,162,114
9 210,199,138
10 244,230,161
11 128,122,85
12 138,138,138
13 169,169,169
14 197,197,197
15 104,104,104
16 178,0,0
17 217,0,0
18 252,0,0
19 133,0,0
20 111,111,178
21 136,136,217
22 158,158,252
23 83,83,133
24 116,116,116
25 142,142,142
26 165,165,165
27 87,87,87
28 0,86,0
29 0,105,0
30 0,123,0
31 0,64,0
32 178,178,178
33 217,217,217
34 252,252,252
35 133,133,133
36 114,117,127
37 139,142,156
38 162,166,182
39 85,87,96
40 105,75,53
41 128,93,65
42 149,108,76
43 78,56,39
44 78,78,78
45 95,95,95
46 111,111,111
47 58,58,58
48 44,44,178
49 54,54,217
50 63,63,252
51 33,33,133
52 99,83,49
53 122,101,61
54 141,118,71
55 74,62,38
56 178,175,170
57 217,214,208
58 252,249,242
59 133,131,127
60 150,88,36
61 184,108,43
62 213,125,50
63 113,66,27
64 124,52,150
65 151,64,184
66 176,75,213
67 93,39,113
68 71,107,150
69 87,130,184
70 101,151,213
71 53,80,113
72 159,159,36
73 195,195,43
74 226,226,50
75 120,120,27
76 88,142,17
77 108,174,21
78 125,202,25
79 66,107,13
80 168,88,115
81 206,108,140
82 239,125,163
83 126,66,86
84 52,52,52
85 64,64,64
86 75,75,75
87 39,39,39
88 107,107,107
89 130,130,130
90 151,151,151
91 80,80,80
92 52,88,107
93 64,108,130
94 75,125,151
95 39,66,80
96 88,43,124
97 108,53,151
98 125,62,176
99 66,33,93
100 36,52,124
101 43,64,151
102 50,75,176
103 27,39,93
104 71,52,36
105 87,64,43
106 101,75,50
107 53,39,27
108 71,88,36
109 87,108,43
110 101,125,50
111 53,66,27
112 107,36,36
113 130,43,43
114 151,50,50
115 80,27,27
116 17,17,17
117 21,21,21
118 25,25,25
119 13,13,13
120 174,166,53
121 212,203,65
122 247,235,76
123 130,125,39
124 63,152,148
125 78,186,181
126 91,216,210
127 47,114,111
128 51,89,178
129 62,109,217
130 73,129,252
131 39,66,133
132 0,151,39
133 0,185,49
134 0,214,57
135 0,113,30
136 90,59,34
137 110,73,41
138 127,85,48
139 67,44,25
140 78,1,0
141 95,1,0
142 111,2,0
143 58,1,0

1.8 Color Table

Code examples

Dark Oak Sapling
This article is a stub. 
You can help by expanding it.
Instructions: 9
Library name Language Link to Map-related code
MCModify Java Map.java

References

Advertisement