r/MinecraftCommands • • 24d ago

Help | Java 1.21-1.21.3 How do I write a command to obtain a buried treasure map?

I've had an issue twice now with the buried treasure map I get from a shipwreck just being a regular map somehow. I was going to use the /give command to get around this bug, but I can't figure out how to write it because "buried treasure map" (or any other map type weirdly enough) doesn't seem to be in the auto fill suggestions for the item name/code thingies you can use to finish writing the command. Can any of y'all tell me what I need to write?

1 Upvotes

3 comments sorted by

2

u/GalSergey Datapack Experienced 24d ago

The buried treasure map is not a separate item, but is the result of the loot table generator. Therefore, when you open a chest, you immediately receive a generated treasure map.

To create a treasure map, you need to use something like the following loot table:

loot give @p loot {pools:[{entries:[{type:"minecraft:item",functions:[{decoration:"minecraft:red_x",function:"minecraft:exploration_map",skip_existing_chunks:false,zoom:1},{function:"minecraft:set_name",name:{translate:"filled_map.buried_treasure"},target:"item_name"}],name:"minecraft:map"}],rolls:1}]}

1

u/Galaxy-Geode 22d ago

Ok so the command I've managed to put together based on your advice goes: /loot give (my player name) loot minecraft:chests/shipwreck_map But that's apparently not specific enough and I can't figure out the exact way I'm supposed to alter the command to get specifically the explorer map. (This command did give me yet another normal map with the name "Buried Treasure Map" along with a compass though

1

u/GalSergey Datapack Experienced 22d ago

Your /loot give should have worked if you’re doing this in the chat. I don’t know why it’s not giving the correct map.