#How to make custom trade with component data

1 messages · Page 1 of 1 (latest)

fading ivy
#

How to make custom villager trade with components in 1.21?
Say I want this item to be ingredient to buy with:
minecraft:music_disc_cat[minecraft:custom_model_data=9001, !minecraft:jukebox_playable,item_name='"Gold Coin"',minecraft:rarity=rare, minecraft:max_stack_size=99]

How do I do it?

thorn schoonerBOT
#

<@&1201956957406109788>

Someone will come and help soon!

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

🙇 If nobody has answered you by <t:1721752532:t>, feel free to use the Summon Helpers button to ping our helper team.

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

coral scaffold
#

Hold that item, stand near the villager, and use this command
/data modify entity @e[type=villager,limit=1,sort=nearest] Offers.Recipes[0].buy from entity @s SelectedItem

Where 0 is the number trade you want to modify -1 (so the first trade in the list is 0, second is 1, etc.)

fading ivy
#

I get this

#

I need to do merge from I assume here

#

but then I get this

wise pier
#

does that villager have a job?

fading ivy
#

oh no it does not, it probably is why

wise pier
#

either way, after you get him to take the trade, you can use a data get command to get the nbt from him to summon them with.

coral scaffold
# fading ivy

I'm writing from memory, so the syntax may be slightly off. Could be ... set from ...

fair oxide
#

It is, yes

fading ivy
#

I wonder if mods look at bug reports marked as invalid if there is new information provided in new comment

#

turns out there is a bug in 1.21 where villagers shows tooltip info like music disk song name or food value even if trade item does not have that component(aka have it removed)

#

It only affects Buy slot it seems