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, 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
      •  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
      •  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. Map item format/header2

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

Map Pixel Art

Map Pixel Art Train

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

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

Original 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
minecraftmap Python __init__.py
mcmapimg Python mcmapimg.py

References

Advertisement