Minecraft Wiki
Advertisement

Maps do not store their information in the item; instead, their data value (listed as "damage" in NBT) corresponds to the map number (ID) of a saved file. Their information is placed in the "data" directory within the world's save directory.

In Java Edition 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.

In Bedrock Edition each map can create 6 files, 1 associated with its original ID, 4 extra files that represent different scales of the map (which are stored as the parentMapIds), and another 1 extra file if the map was locked with a glass pane.

When used in the Nether, maps render as a kind of static, making them unreadable.

Data folder structure[]

In Java Edition 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.

In Bedrock Edition the map item files are contained in the mojang variant of the LevelDB file format. Each map's file name only uses its own unique number, without using any prefix.


map_<#>.dat format (Java)[]

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 wide blocks square per pixel, even for 0, where the map is 1:1). Default 3, minimum 0 and maximum 4.
      •  dimension: For <1.16 (byte): 0 = The Overworld, -1 = The Nether, 1 = The End, any other value = a static image with no player pin. In >=1.16 this is the resource location of a dimension instead. [more information needed]
      •  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 makes 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.

LevelDB format (Bedrock)[]

NBT structure[]

  • : The root tag.
    •  mapId: The Unique ID of the map.
    •  parentMapId: The Unique ID's of the parent maps.
    •  dimension: 0 = The Overworld, 1 = The Nether, 2 = The End, any other value = a static image with no player pin.
    •  fullExplored: 1 if the map is full explored.
    •  mapLocked: 1 if the map has been locked in a cartography table.
    •  scale: How zoomed in the map is, and must be a number between 0 and 4 (inclusive) that represent the level. Default 0. If this is changed in an anvil or a cartography table the Unique ID of the map change.
    •  unlimitedTracking: Unknown. Default 0.
    •  height: The height of the map. Is associated with the scale level.
    •  width The width of the map. Is associated with the scale level.
    •  xCenter: Center of the map according to real world by X.
    •  zCenter: Center of the map according to real world by Z.
    •  decorations: A list of optional icons to display on the map.
      • : An individual decoration.
        •  data
          •  rot: The rotation of the symbol, ranging from 0 to 15. South = 0, West = 4, North = 8, East = 12.
          •  type: The ID of the map icon to display.
          •  x: The horizontal column (x) where the decoration is located on the map (per pixel).
          •  y: The vertical column (y) where the decoration is located on the map (per pixel).
        •  key
          •  blockX: The world x-position of the decoration.
          •  blockY: The world y-position of the decoration.
          •  blockZ: The world z-position of the decoration.
          •  type: Unknown.
    •  colors: An array of bytes that represent color values (65536 entries for a default 128×128 map).

idcounts.dat format[]

This file keeps track of the latest map added. It is stored as a Gzip'd NBT file.

NBT structure[]

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

Color table[]

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

Base colors[]

The data for Java release versions is current as of 1.17.1. (needs to be checked/updated to 1.21). 23:22, 14 July 2021 (UTC)
The data for Java snapshots is current as of 21w10a. 21:40, 14 March 2021 (UTC)

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. (Note: ID 0 has 4 gradients of itself despite them all being transparent)

ID Color RGB Blocks
0 NONE Transparent Air, Void Air, Cave Air, Barrier, Redstone Lamp, Cake (including cake with Candles), Powered Rail, Detector Rail, Torch, Redstone Wire, Ladder, Rail, Lever, Redstone Torch, Buttons, Repeater, Tripwire Hook, Tripwire, Flower Pot (including potted plants), Head, Comparator, Activator Rail, End Rod, Glass, Glass Pane, Nether Portal, Stained Glass Pane (all colors), Structure Void, Iron Bars, Soul Fire Torch, Chain, Light Block
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, Candle, Ochre Froglight
3 WOOL 199, 199, 199 Cobweb, Mushroom Stem, Bed (head), White Candle
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 (all damage levels), Grindstone, Soul Fire Lantern, Lodestone
7 PLANT 0, 124, 0 Sapling, Flowers, Wheat, Sugar Cane, Pumpkin Stem, Melon Stem, Lily Pad, Cocoa, Carrots, Potatoes, Beetroots, Sweet Berry Bush, Grass, Fern, Vines, Leaves, Cactus, Bamboo, Cave Vines, Spore Blossom, (Flowering) Azalea, Dripleaf (big and small)
8 SNOW 255, 255, 255 Snow, Snow Block, White (Bed (foot), Wool, Stained Glass, Carpet, Shulker Box, Glazed Terracotta, Concrete, Concrete Powder), Powder Snow
9 CLAY 164, 168, 184 Clay, Infested Block (not including infested Deepslate)
10 DIRT 151, 109, 77 Dirt, Coarse Dirt, Farmland, Dirt 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, Rooted Dirt, Hanging Roots, Packed Mud
11 STONE 112, 112, 112 Stone (slab, stairs), Andesite (slab, stairs, wall), Polished Andesite (slab, stairs), Cobblestone (slab, stairs, wall), 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), Observer, Smoker, Blast Furnace, Stonecutter, Sticky Piston, Piston, Piston Head, Gravel, Acacia Log (side), Cauldron (including cauldrons with water, lava, or powdered snow), Hopper, Copper Ore
12 WATER 64, 64, 255 Kelp, Seagrass, Water, Bubble Column, Waterlogged Leaves
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, Banners (all colors, when not as markers)
14 QUARTZ 255, 252, 245 Diorite (stairs, slab, wall), Polished Diorite (stairs, slab), Birch Log (side), Quartz Block (all variants, all slabs, all stairs), Sea Lantern, Target
15 COLOR_ORANGE 216, 127, 51 Acacia (Planks, Log (vertical), Stripped Log, Stripped Wood, Sign, Trapdoor, Slab, Stairs, Pressure Plate, Fence Gate, Fence, Door), Red Sand, Orange (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Pumpkin, Carved Pumpkin, Jack o'Lantern, Terracotta, Red Sandstone (all variants, all stairs, all slabs, all walls), Honey Block, Honeycomb Block, Block of Copper (including all cut, waxed, stair, and slab variants), Lightning Rod, Block of Raw Copper
16 COLOR_MAGENTA 178, 76, 216 Magenta (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Purpur (all variants, slab, stairs)
17 COLOR_LIGHT_BLUE 102, 153, 216 Light Blue (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Soul Fire
18 COLOR_YELLOW 229, 229, 51 Sponge, Wet Sponge, Yellow (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Hay Bale, Horn Coral (Coral Block, Coral, Coral Fan), Bee Nest
19 COLOR_LIGHT_GREEN 127, 204, 25 Lime (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Melon
20 COLOR_PINK 242, 127, 165 Pink (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Brain Coral (Coral Block, Coral, Coral Fan), Pearlescent Froglight
21 COLOR_GRAY 76, 76, 76 Acacia Wood, Gray (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Dead Coral (Coral Block, Coral, Coral Fan), Tinted Glass
22 COLOR_LIGHT_GRAY 153, 153, 153 Light Gray (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Structure Block, Jigsaw Block
23 COLOR_CYAN 76, 127, 153 Cyan (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Prismarine (slab, stairs, wall), Warped (Roots, Fungus), Twisting Vines, Nether Sprouts, Sculk Sensor
24 COLOR_PURPLE 127, 63, 178 Shulker Box, Purple (Wool, Carpet, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Mycelium, Chorus Plant, Chorus Flower, Repeating Command Block, Bubble Coral (Coral Block, Coral, Coral Fan), Amethyst Block, Budding Amethyst, Amethyst Cluster, Amethyst Bud (all sizes)
25 COLOR_BLUE 51, 76, 178 Blue (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), 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, Glazed Terracotta, Concrete, Concrete Powder, Candle), Soul Sand, Command Block, Brown Mushroom, Soul Soil, Mud Brick Slab
27 COLOR_GREEN 102, 127, 51 Green (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), End Portal Frame, Chain Command Block, Sea Pickle, Moss Carpet, Moss Block, Dried Kelp Block
28 COLOR_RED 153, 51, 51 Red (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Bricks (slab, stairs, wall), Red Mushroom Block, Nether Wart, Enchanting Table, Nether Wart Block, Fire Coral (Coral Block, Coral, Coral Fan), Red Mushroom, Shroomlight, Mangrove (Planks, Log (vertical), Stripped Log, Wood, Stripped Wood, Sign, Door, Pressure Plate, Fence, Trapdoor, Fence Gate, Slab, Stairs)
29 COLOR_BLACK 25, 25, 25 Black (Wool, Carpet, Shulker Box, Bed (foot), Stained Glass, Glazed Terracotta, Concrete, Concrete Powder, Candle), Obsidian, End Portal, Dragon Egg, Block of Coal, End Gateway, Basalt, Polished Basalt, Smooth Basalt, Block of Netherite, Ancient Debris, Crying Obsidian, Respawn Anchor, Blackstone (all variants, all stairs, all slabs, all walls), Gilded Blackstone, Sculk, Sculk Vein, Sculk Catalyst, Sculk Shrieker
30 GOLD 250, 238, 77 Block of Gold, Light Weighted Pressure Plate, Bell, Block of Raw Gold
31 DIAMOND 92, 219, 213 Block of Diamond, Beacon, Prismarine Bricks (slab, stairs), Dark Prismarine (slab, stairs), Conduit
32 LAPIS 74, 128, 255 Block of Lapis Lazuli
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, Soul Campfire, Mangrove Log (side), Mangrove Roots, Muddy Mangrove Roots
35 NETHER 112, 2, 0 Netherrack, Nether Bricks (fence, slab, stairs, wall, chiseled, cracked), Nether Gold Ore, Nether Quartz Ore, Magma Block, Red Nether Bricks (slab, stairs, wall), Crimson (Roots, Fungus), Weeping Vines
36 TERRACOTTA_WHITE 209, 177, 161 White Terracotta, Calcite
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, Tuff
44 TERRACOTTA_LIGHT_GRAY 135, 107, 98 Light Gray Terracotta, Exposed Copper (including all cut, waxed, stair, and slab variants), Mud Bricks (stairs, wall)
45 TERRACOTTA_CYAN 87, 92, 92 Cyan Terracotta, Mud
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, Pointed Dripstone, Dripstone Block
49 TERRACOTTA_GREEN 76, 82, 42 Green Terracotta
50 TERRACOTTA_RED 142, 60, 46 Red Terracotta, Decorated Pot
51 TERRACOTTA_BLACK 37, 22, 16 Black Terracotta
52 CRIMSON_NYLIUM 189, 48, 49 Crimson Nylium
53 CRIMSON_STEM 148, 63, 97 Crimson (Fence, Fence Gate, Planks, Pressure Plate, Sign, Slab, Stairs, Stem, Stripped Stem, Trapdoor, Door)
54 CRIMSON_HYPHAE 92, 25, 29 Crimson (Hyphae, Stripped Hyphae)
55 WARPED_NYLIUM 22, 126, 134 Warped Nylium, Oxidized Copper (including all cut, waxed, stair, and slab variants)
56 WARPED_STEM 58, 142, 140 Warped (Fence, Fence Gate, Planks, Pressure Plate, Sign, Slab, Stairs, Stem, Stripped Stem, Trapdoor, Door), Weathered Copper (including all cut, waxed, stair, and slab variants)
57 WARPED_HYPHAE 86, 44, 62 Warped (Hyphae, Stripped Hyphae)
58 WARPED_WART_BLOCK 20, 180, 133 Warped Wart Block
59 DEEPSLATE 100, 100, 100 Deepslate (Gold Ore, Iron Ore, Coal Ore, Lapis Ore, Diamond Ore, Redstone Ore, Emerald Ore, Copper Ore), Deepslate (all variants, all stairs, all slabs, and all walls), Infested Deepslate, Reinforced Deepslate
60 RAW_IRON 216, 175, 147 Block of Raw Iron
61 GLOW_LICHEN 127, 167, 150 Glow Lichen, Verdant Froglight

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 down to a whole number. As of 1.8.1-pre1, 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 = Multiplier
Base Color ID×4 + 0 180 0.71
Base Color ID×4 + 1 220 0.86
Base Color ID×4 + 2 255 (same color) 1
Base Color ID×4 + 3 135 0.53
Map colors

All the different shades of each color

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 128×128 and reads each block as a specific color. By placing blocks in a specific arrangement, it is possible to create pixel art images. Constructing the image will cover an square area 8 chunks on a side, and require 16,384 blocks (256 stacks worth) not counting any support blocks.

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 58 colors. The staircase method offers 174 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 is 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. (This is a case of the mapping convention of top lighting.)

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.

Full color tables[]

The content of this section is disputed. 
The color IDs for 1.7.2, 1.8.1, and 1.12 appear incompatible with each other, which conflicts with third-party code samples.
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.

Code examples[]

Listed below are some libraries used for modifying and exporting map data.

Library name, color version Language Link to Map-related code
MCModify (1.8) Java Map.java
minecraftmap (1.7) Python __init__.py
mcmapimg (1.19) Python mcmapimg.py
MapColors (1.21) Java github.com/nothub/MapColors

History[]

Clock JE3
This section needs to be updated. 
Please update this section to reflect recent updates or newly available information.
Reason: Incomplete history. TODO: find versions where block colors were added for new blocks
Java Edition Beta
?When Notch was adding maps for the first time he did not use the NBT format.[1]
1.6Test Build 3Added maps.
Map IDs are limited to the size of a short (32,768).[2]
Java Edition
1.8.1pre1Added the color "NETHER" (35), increasing the number of base colors from 35 to 36.
The shading multiplier for the fourth color is changed from 220 (0.86) to 135 (0.53).
1.1217w17aAdded 16 map colors for every color of terracotta: "TERRACOTTA_WHITE" (36), "TERRACOTTA_ORANGE" (37), "TERRACOTTA_MAGENTA" (38), "TERRACOTTA_LIGHT_BLUE" (39), "TERRACOTTA_YELLOW" (40), "TERRACOTTA_LIGHT_GREEN" (41), "TERRACOTTA_PINK" (42), "TERRACOTTA_GRAY" (43), "TERRACOTTA_LIGHT_GRAY" (44), "TERRACOTTA_CYAN" (45), "TERRACOTTA_PURPLE" (46), "TERRACOTTA_BLUE" (47), "TERRACOTTA_BROWN" (48), "TERRACOTTA_GREEN" (49), "TERRACOTTA_RED" (50), and "TERRACOTTA_BLACK" (51), increasing the number of base colors from 36 to 52.
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.
19w04aAdded DataVersion to idcounts.dat.
idcounts.dat is now gzipped.
1.16Pre-release 6Added 7 new colors: "CRIMSON_NYLIUM" (52), "CRIMSON_STEM" (53), "CRIMSON_HYPHAE" (54), "WARPED_NYLIUM" (55), "WARPED_STEM" (56), "WARPED_HYPHAE" (57), and "WARPED_WART_BLOCK" (58), increasing the number of base colors from 52 to 59.

References[]

Advertisement