#How to rename some of the maps that Cartographers sell in the Villager Trading Rebalance (1.21)

1 messages · Page 1 of 1 (latest)

gusty roost
#

I'm making a skyblock map and I want cartographers to sell maps to the bounding boxes of different structures so the player can find them even though there aren't any blocks. So far, I've found a couple different ways to make maps to point to whatever structure I want (by adding the structure to the on_trial_chambers_maps file in tags/worldgen/structure or by changing the start pool of the default structure), but I'm running into two problems.

First, if possible, I'd like to make structures show up on the maps that were added in the Villager Trading Rebalance, like Savanna Village maps, but just adding the data from the rebalance pack into my minecraft folder isn't working. Like just adding on_savanna_village_maps to the same folder as on_trial_chambers_maps and adding a structure to it doesn't seem to be changing anything

Second, I need a way of making cartographers sell trial chamber maps that have been renamed based on the structure they really point to, so like giving it a custom name that says "Nether Fortress Map" or something. I can make the map point to the structure, but I can't figure out how to use Misode or anything to generate a map with a custom name as part of a villager trade. I could maybe change the lang file, but I wanted to check if there's a better way. I'd also like to be able to add Buried Treasure maps to the cartographer's trades, especially if I can't get the Villager Rebalance maps to work, because that would mean I only have four map types to work with including treasure.

young stormBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

fast spindle
#

Unfortunately villager trade tables are not data-driven, so the only way you'd be able to change the names of the maps is by modifying that data in the villager entity after it already has that trade

gusty roost
#

I would be willing to set it up with functions to just manually detect villagers with that trade, then remove it and add a new one with nbt or something if that would work

fast spindle
#

I'm not sure I fully follow what you've tried for your first question

fast spindle
gusty roost
#

I'm just not sure what functions to use

fast spindle
#

?

#

You use functions you make

gusty roost
#

Like I'm not sure what I would put in the .mcfunction file to make that happen

#

But I tried taking the files that are in the experimental data pack folder and moving them into my minecraft folder in my data pack

west oak
gusty roost
#

I got the files from here

fast spindle
#

Well, probably in your tick function (or in a scheduled function for better performance), you'd need to execute a function as all villagers. Either in that same command or in the function that gets run that way, you'd need to detect if that villager has a trade for a map (and know which recipe number it is), and if so, use /data modify to edit that sell item

gusty roost
gusty roost
serene tree
#

You can use mcstacker to figure out the correct syntax and NBT paths

fast spindle
#

The wiki can be extremely useful for seeing what NBT entities like villagers have

hardy pendantBOT
#
MCStacker
About

MCStacker is a Minecraft command generator, focusing on generating commands with NBT/item components easily without having to write long commands by hand.

west oak
#

well you would probably find a villager with the trade you need and then do /data get entity on it to inspect the villager's NBT and find the resource location of what you're looking for

gusty roost
#

I'll do some digging on that site, thanks! In the meantime, any idea how I would make the Villager Rebalance Maps work the way the regular ones are?

fast spindle
serene tree
#

The actual villager trade stuff is hardcoded within that special datapack. The pack.mcmeta enables a special hardcoded setting within the Minecraft jar files. You can theoretically copy over that special bit of pack.mcmeta to your own datapack to apply the hardcoded changes to your pack

gusty roost
#

I'm not sure where to start, but what I want is that when you create a world using experimental settings and the one block data pack, cartographers will sell Savanna Village maps that actually point to one of my custom structures

#

Ok, here's my updated pack.mcmeta:

{
"features": {
"enabled": [
"minecraft:trade_rebalance",
"minecraft:bundle"
]
},
"pack": {
"pack_format": 48,
"description": "Skyblock Data Pack"
}
}

serene tree
gusty roost
#

For sure, I'm more just stuck at figuring out what exact NBT it takes to make a Buried Treasure Map with a custom name, etc.

west oak
gusty roost
#

(The Villager Rebalance part is working now though! 👍)

gusty roost
serene tree
#

The map_decorations controls the icons on maps

fast spindle
gusty roost
#

So would I need to manually add an X where I want it? Or is there a way to make the map generate the way a regular "Buried Treasure Map" would inside of chests, where it already points to a structure?

serene tree
#

Is the position on the map always gonna be the same? If so, it’s really easy to get a map which has an X at a specific position

gusty roost
#

No, I want it to naturally be able to tell you where certain generated structures are

fast spindle
#

Then you'll need to generate the map with a loot table, and then copy that data to the villager. There's a loot table function for creating explorer maps

gusty roost
#

Oh perfect, I wasn't able to figure out the specifics of that using Misode or anything, what's the syntax for explorer maps in loot tables like that?

fast spindle
#

As an example:

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "minecraft:item",
          "name": "minecraft:filled_map",
          "functions": [
            {
              "function": "minecraft:exploration_map",
              "destination": "minecraft:on_ocean_explorer_maps",
              "decoration": "monument",
              "search_radius": 8,
              "skip_existing_chunks": false
            }
          ]
        }
      ]
    }
  ]
}

Definitely recommending using Misode for this

gusty roost
#

Definitely, I just wasn't sure where to start. That's exactly what I need! 🙂

fast spindle
#

I don't recall if you need to use Filled Map or just Map

west oak
fast spindle
#

Correct

west oak
#

alright

gusty roost
serene tree
#

yeah exactly that

fast spindle
#

Just like a chest or something to use temporarily, yes

gusty roost
#

Gotcha, there's not a way to just directly make the cartographer sell a map that follows that loot table without a middle man?

serene tree
#

Unfortunately not because the trades are hardcoded

gusty roost
#

Ok I see, like even the data command returns a map with pre-filled coordinates

#

So is there any way to generate a map using that loot table without placing a block that might destroy something? Or to just take a villager with an existing trade and change the name of it? I could sacrifice the Buried Treasure map part as long as I have enough maps to use from the Villager Rebalance

#

Like how would I just take every cartographer with a trade called "filled_map.village_savannah" and change that one trade to just be called "Nether Fortress Map"?

west oak
#

it's really not more complicated than that

gusty roost
#

Right, I just don't love that that would replace any blocks the player happened to place at 0 -64 0

serene tree
#

basically:
as every cartographer which doesn’t have that trade already -> do what cjendantix said

west oak
serene tree
#

y=-64 is bedrock in the overworld

fast spindle
#

You could set the block the villager's head is in, since it's unlikely a block will be there

west oak
gusty roost
#

If I was willing to sacrifice the custom loot table part and just rename existing trades that the cartographer already has, would that make a difference?

serene tree
west oak
#

yeah

serene tree
#

as long as you set it back to bedrock afterwards lol

gusty roost
serene tree
#

If it’s a skyblock map it’s probably air

west oak
gusty roost
#

Right, unless you create like a floor to your world

serene tree
#

But using the position of an entity is pretty much almost gonna be air

#

You can also use /loot drop, to get it as an item entity

#

or whatever the syntax is

gusty roost
#

But just renaming the trade isn't any easier?

serene tree
#

Probably not tbh

#

It’s pretty easy to just add the trade to the villager if it doesn’t have it already

gusty roost
#

Yeah, I just don't want the villager to also sell Savanna Village Maps that aren't renamed

west oak
fast spindle
#

Unfortunately at a certain point, you have to accept that data packs are not mods. We have limitations, and sometimes we can get around those limitations, but only with janky workarounds that sacrifice something

gusty roost
west oak
#

It's really not that complicated!

gusty roost
west oak
#

what isn't ideal?

gusty roost
west oak
#

sure but if you want you can set the blocks around it to be bedrock so it's inaccessible. It will fit in with the pattern that far down

gusty roost
#

I understand what you're saying. This map is not going to have bedrock in it. It is a skyblock map

gusty roost
#

No worries 👍 I think setting the block the villager's feet are in for a split second might be the best workaround, otherwise I'll just change the lang file

west oak
gusty roost
#

I was able to change where it points using tags, but yeah, the only reason it would matter to be able to generate the actual loot table is if I wanted to include maps that they don't natively sell, like Buried Treasure maps instead of just normal Explorer maps

#

Thank you all for your help! I think I got it from here 🙂