Hi Gamepedia users and contributors! Please complete this survey to help us learn how to better meet your needs in the future. We have one for editors and readers. This should only take about 7 minutes!

Map item format

From Minecraft Wiki
(Redirected from Idcounts.dat)
Jump to: navigation, search
Cleanup.svg
This article may need cleanup to improve its quality, possibly to comply with the style guide. Discuss
Please help the Minecraft Wiki 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]

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 Blocks
0 NONE Transparent Air, Void Air, Cave Air, Barrier, Redstone Lamp, Cake, Powered Rail, Detector Rail, Torch, Redstone Wire, Ladder, Rail, Lever, Redstone Torch, Buttons, Repeater, Tripwire Hook, Tripwire, Flower Pot, Head, Comparator, Activator Rail, End Rod, Glass, Glass Pane, Nether Portal, Structure Void, Iron Bars
1 GRASS 127, 178, 56 Grass Block, Slime Block
2 SAND 247, 233, 163 Sand, Birch (Planks, Log (vertical), Stripped Log, Wood, Stripped Wood, Sign, Pressure Plate, Trapdoor, Stairs, Slab, Fence Gate, Fence, Door), Sandstone (All variants, all slabs, all stairs, all walls), Glowstone, End Stone, End Stone Bricks (slab, stairs, wall), Bone Block, Turtle Egg, Scaffolding
3 WOOL 199, 199, 199 Cobweb, Mushroom Stem, Bed (head)
4 FIRE 255, 0, 0 Lava, TNT, Fire, Redstone Block
5 ICE 160, 160, 255 Ice, Frosted Ice, Packed Ice, Blue Ice
6 METAL 167, 167, 167 Block of Iron, Iron Door, Brewing Stand, Heavy Weighted Pressure Plate, Iron Trapdoor, Lantern, Anvil, Grindstone
7 PLANT 0, 124, 0 Sapling, Flowers, Mushrooms, Wheat (block), Sugar Cane, Pumpkin Stem, Melon Stem, Lily Pad, Cocoa, Carrots, Potatoes, Beetroots, Sweet Berry Bush, Grass, Fern, Vines, Leaves, Cactus, Bamboo
8 SNOW 255, 255, 255 Snow, Snow Block, White (Bed (foot), Wool, Stained Glass, Stained Glass Pane, Carpet, Banner, Shulker Box, Glazed Terracotta, Concrete, Concrete Powder)
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 Dirt, Coarse Dirt, Farmland, Grass Path, Granite (slab, stairs, wall), Polished Granite (slab, stairs), Jungle (Planks, Log (vertical), Stripped Log, Wood, Stripped Wood, Sign, Pressure Plate, Trapdoor, Stairs, Slab, Fence Gate, Fence, Door), Jukebox, Brown Mushroom Block
11 STONE 112, 112, 112 Stone (slab, stairs), Andesite (slab, stairs, wall), Polished Andesite (slab, stairs), Cobblestone (slab, stairs), Bedrock, Gold Ore, Iron Ore, Coal Ore, Lapis Lazuli Ore, Dispenser, Mossy Cobblestone (slab, stairs, wall), Spawner, Diamond Ore, Furnace, Stone Pressure Plate, Redstone Ore, Stone Bricks (all variants, all slabs, all stairs, all walls), Emerald Ore, Ender Chest, Dropper, Smooth Stone (slab, stairs), Observer, Smoker, Blast Furnace, Stonecutter, Sticky Piston, Piston, Piston Head, Gravel, Acacia Log (side), Cauldron, Hopper
12 WATER 64, 64, 255 Kelp, Seagrass, Water, Bubble Column
13 WOOD 143, 119, 72 Oak (Planks, Log (vertical), Stripped Log, Wood, Stripped Wood, Sign, Door, Pressure Plate, Fence, Trapdoor, Fence Gate, Slab, Stairs), Note Block, Bookshelf, Chest, Crafting Table, Trapped Chest, Daylight Detector, Loom, Barrel, Cartography Table, Fletching Table, Lectern, Smithing Table, Composter, Bamboo Sapling, Dead Bush, Petrified Oak Slab, Beehive[upcoming: JE 1.15], Bee Nest[upcoming: JE 1.15]
14 QUARTZ 255, 252, 245 Diorite, Polished Diorite, Birch Log (side), Quartz Block (all variants, all slabs, all stairs), Sea Lantern
15 COLOR_ORANGE 216, 127, 51 Acacia (Planks, Log (vertical), Stripped Log, Stripped Wood, Sign, Trapdoor, Slab), Red Sand, Orange (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Pumpkin, Carved Pumpkin, Jack o'Lantern, Terracotta, Red Sandstone (all variants, all stairs, all slabs, all walls), Honey Block[upcoming: JE 1.15], Honeycomb Block[upcoming: JE 1.15]
16 COLOR_MAGENTA 178, 76, 216 Magenta (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Purpur (all variants, slab, stairs)
17 COLOR_LIGHT_BLUE 102, 153, 216 Light Blue (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder)
18 COLOR_YELLOW 229, 229, 51 Sponge, Wet Sponge, Yellow (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Hay Bale, Horn Coral (Coral Block, Coral, Coral Fan)
19 COLOR_LIGHT_GREEN 127, 204, 25 Lime (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Melon
20 COLOR_PINK 242, 127, 165 Pink (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Brain Coral (Coral Block, Coral, Coral Fan)
21 COLOR_GRAY 76, 76, 76 Acacia Wood, Gray (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Dead Coral (Coral Block, Coral, Coral Fan)
22 COLOR_LIGHT_GRAY 153, 153, 153 Light Gray (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Structure Block, Jigsaw Block
23 COLOR_CYAN 76, 127, 153 Cyan (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Prismarine (slab, stairs, wall)
24 COLOR_PURPLE 127, 63, 178 Shulker Box, Purple (Wool, Carpet, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Mycelium, Chorus Plant, Chorus Flower, Repeating Command Block, Bubble Coral (Coral Block, Coral, Coral Fan)
25 COLOR_BLUE 51, 76, 178 Blue (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Tube Coral (Coral Block, Coral, Coral Fan)
26 COLOR_BROWN 102, 76, 51 Dark Oak (Planks, Log, Stripped Log, Wood, Stripped Wood, Sign, Pressure Plate, Trapdoor, Stairs, Slab, Fence Gate, Fence, Door), Spruce Log (side), Brown (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Soul Sand, Command Block
27 COLOR_GREEN 102, 127, 51 Green (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), End Portal Frame, Chain Command Block, Dried Kelp Block, Sea Pickle
28 COLOR_RED 153, 51, 51 Red (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Bricks (slab, stairs, wall), Red Mushroom Block, Nether Wart, Enchanting Table, Nether Wart Block, Fire Coral (Coral Block, Coral, Coral Fan)
29 COLOR_BLACK 25, 25, 25 Black (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Stained Glass Pane, Banner, Glazed Terracotta, Concrete, Concrete Powder), Obsidian, End Portal, Dragon Egg, Coal Block, End Gateway
30 GOLD 250, 238, 77 Block of Gold, Light Weighted Pressure Plate, Bell
31 DIAMOND 92, 219, 213 Block of Diamond, Beacon, Prismarine Bricks (slab, stairs), Dark Prismarine (slab, stairs), Conduit
32 LAPIS 74, 128, 255 Lapis Lazuli Block
33 EMERALD 0, 217, 58 Block of Emerald
34 PODZOL 129, 86, 49 Podzol, Spruce (Planks, Log (vertical), Stripped Log, Wood, Stripped Wood, Sign, Pressure Plate, Trapdoor, Stairs, Slab, Fence Gate, Fence, Door), Oak Log (side), Jungle Log (side), Campfire
35 NETHER 112, 2, 0 Netherrack, Nether Bricks (fence, slab, stairs, wall), Nether Quartz Ore, Magma Block, Red Nether Bricks (slab, stairs, wall)
36 TERRACOTTA_WHITE 209, 177, 161 White Terracotta
37 TERRACOTTA_ORANGE 159, 82, 36 Orange Terracotta
38 TERRACOTTA_MAGENTA 149, 87, 108 Magenta Terracotta
39 TERRACOTTA_LIGHT_BLUE 112, 108, 138 Light Blue Terracotta
40 TERRACOTTA_YELLOW 186, 133, 36 Yellow Terracotta
41 TERRACOTTA_LIGHT_GREEN 103, 117, 53 Lime Terracotta
42 TERRACOTTA_PINK 160, 77, 78 Pink Terracotta
43 TERRACOTTA_GRAY 57, 41, 35 Gray Terracotta
44 TERRACOTTA_LIGHT_GRAY 135, 107, 98 Light Gray Terracotta
45 TERRACOTTA_CYAN 87, 92, 92 Cyan Terracotta
46 TERRACOTTA_PURPLE 122, 73, 88 Purple (Terracotta, Shulker Box)
47 TERRACOTTA_BLUE 76, 62, 92 Blue Terracotta
48 TERRACOTTA_BROWN 76, 50, 35 Brown Terracotta
49 TERRACOTTA_GREEN 76, 82, 42 Green Terracotta
50 TERRACOTTA_RED 142, 60, 46 Red Terracotta
51 TERRACOTTA_BLACK 37, 22, 16 Black Terracotta

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

History[edit]

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.

References[edit]