Map item format

From Minecraft Wiki
(Redirected from Idcounts.dat)
Jump to: navigation, search
This article may need cleanup to improve its quality, possibly to comply with the style guide. Discuss
Please help us clean up this page if you can. The talk page may contain suggestions.
Information icon.svg
This feature is exclusive to Java Edition.

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.

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 = 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 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. Defaults to 0 for maps created from an empty map and 1 for Explorer Maps.
      •  locked: 1 if the map has been locked in a cartography table.
      •  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 128×128 map). Color can be accessed via the following method: colorID = Colors[widthOffset + heightOffset * width], where (widthOffset==0, heightOffset==0) is left upper point.
    •  DataVersion: The version the map was created. If not present, defaults to 1343 (1.12.2)

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.
    •  Data
      •  map: Latest map ID.
    •  DataVersion

Color table[edit]

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

Base colors[edit]

This section needs updating.
Description: 1.13 has added new block colors

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, Barrier, Iron Bars, 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), Scaffolding
3 CLOTH 199, 199, 199 Mushroom Stem 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, Blue Ice
6 IRON 167, 167, 167 Block of Iron, Lantern, Grindstone Iron Door, Iron Trapdoor, 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, White Shulker Box 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, Grindstone, Smoker, Blast Furnace, Dead Coral Block 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, Smithing Table, Lectern, Fletching Table, Cartography Table, Barrel, Loom, Composter 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 Shulker Box, 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 Carpet, Orange Stained Glass, Orange Stained Glass Pane
1.12 Onwards: Orange Bed foot
16 MAGENTA 178, 76, 216 Purpur (Block, Pillar, Slab), Magenta Wool, Magenta Shulker Box
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, Light Blue Shulker Box
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, Yellow Shulker Box
1.12 Onwards: Yellow Glazed Terracotta, Yellow Concrete, Yellow Concrete Powder, Horn Coral Block
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, Lime Shulker Box
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, Pink Shulker Box, Brain Coral Block
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, Gray Shulker Box
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, Light Gray Shulker Box
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, Cyan Shulker Box
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, Undyed Shulker Box, Bubble Coral Block
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, Blue Shulker Box, Tube Coral Block
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, Brown Shulker Box
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, Green Shulker Box
1.12 Onwards: Green Glazed Terracotta, Green Concrete, Green Concrete Powder
Before 1.12: Green Stained Hardened Clay, Dried Kelp Block
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, Red Shulker Box
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, Fire Coral Block
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, Black Shulker Box
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, Bell 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 Purple Shulker Box1.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 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 128×128 and will read each block as a specific color. By placing blocks in a specific arrangement, it is possible to create pixel art images.

Two methods exist for creating map pixel art: flat and staircase. The flat method involves laying the pixel image across a flat surface, effectively creating a floor. The flat method is the easier of the two methods, but offers a smaller palette of only 51 colors. The staircase method offers 153 colors, but is much more complicated to use. In the staircase method, blocks are placed at different elevations to obtain specific color variations. A block’s color will be darker if placed at a lower elevation than the block north of it, or brighter if placed at a higher elevation than the block north of it.

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 color groups below can be used. The 4th shade can only be obtained 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, meaning that it lacks some important information. You can help by expanding it with further information relating to the topic.
Library name Language Link to Map-related code
MCModify Java
minecraftmap Python
mcmapimg Python


This section needs updating.
Description: Incomplete history, maybe
Java Edition Beta
?When Notch was adding maps for the first time he did not use the NBT format.[1]
1.6?Added maps.
Map IDs are is limited to the size of a short (32,768).[2]
Java Edition
1.1317w47aMaps ids are no longer shorts, but rather ints, as they are no longer based on damage values of the item.
idcounts.dat now uses an int instead of a short.
18w19aAdded DataVersion to saved map_<#>.dat. (idcounts.dat still doesn't have a DataVersion)
1.1419w02aAdded locked to saved map_<#>.dat.