Map item format

From Minecraft Wiki
File:258inv.png This article or section requires a cleanup in order to meet the Minecraft Wiki's quality standards.
Please edit this page to improve it.
File:258inv.png

Template:Exclusive 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

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

  • Template:Nbt The root tag.
    • Template:Nbt: The map data.
      • Template:Nbt: 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.
      • Template:Nbt: 0 = The Overworld, -1 = The Nether, 1 = The End, any other value = a static image with no player pin.
      • Template:Nbt: 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.
      • Template:Nbt: 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.
      • Template:Nbt: 1 if the map has been locked in a cartography table.
      • Template:Nbt: Center of map according to real world by X.
      • Template:Nbt: Center of map according to real world by Z.
      • Template:Nbt: List of banner markers added to this map. May be empty.
        • Template:Nbt A banner marker.
          • Template:Nbt: 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.
          • Template:Nbt: The custom name of the banner, in JSON text. May not exist.
          • Template:Nbt: The block position of the banner in the world.
      • Template:Nbt: List map markers added to this map. May be empty.
      • Template:Nbt: 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.
    • Template:Nbt: 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

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

NBT structure

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

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, Soul Fire TorchTemplate:Upcoming
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, Soul Fire LanternTemplate:Upcoming
7 PLANT 0, 124, 0 Sapling, Flowers, Mushrooms,Template:Until Wheat, Sugar Cane, Pumpkin Stem, Melon Stem, Lily Pad, Cocoa, Carrots, Potatoes, Beetroots, Sweet Berry Bush, Grass, Fern, Vines, Leaves, Cactus, Bamboo, Fungi, Weeping Vines
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, Bee Nest
14 QUARTZ 255, 252, 245 Diorite, Polished Diorite, 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), 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, Honeycomb Block
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), Soul FireTemplate:Upcoming
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), Warped (Stem, Stripped Stem, Hyphae, Stripped Hyphae, Nylium, Wart Block, Roots, Planks, Slab, Pressure Plate, Fence, Trapdoor, Fence Gate, Stairs, Door, Sign), Nether Sprouts
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, Brown MushroomTemplate:Upcoming, Soul SoilTemplate:Upcoming
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), Red Mushroom,Template:Upcoming Crimson (Stem, Stripped Stem, Hyphae, Stripped Hyphae, Nylium), Shroomlight
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, Basalt,Template:Upcoming Block of Netherite, Ancient Debris, Crying Obsidian
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), Crimson (Roots, Planks, Slab, Pressure Plate, Fence, Trapdoor, Fence Gate, Stairs, Door, Sign)
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

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
File:Map Colour Shades.png
All the different shades of each color, excluding water
All the different shades of each map color, excluding water as of 1.12

Map Pixel Art

File:Map Pixel Art Train.jpg
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

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

Click to view a list of all the stubs in this wiki! Wait! I'm still growing!

This article is a stub. You can help the Minecraft Wiki by expanding this article.
9

Click to view a list of all the stubs in this wiki!
Library name Language Link to Map-related code
MCModify Java Map.java
minecraftmap Python __init__.py
mcmapimg Python mcmapimg.py

History

Template:Needs update

youarecrazyright youarecrazyright youarecrazyright youarecrazyright youarecrazyright youarecrazyright youarecrazyright youarecrazyright

References


Template:Java Edition

de:Kartendaten fr:Format de carte (objet) ja:地図アイテムフォーマット nl:Kaart object formaat zh:地图物品格式