How to add a tag for a villager trade
So I made a quest where the player kills a mob gets a weapon then sells to the villager
/summon villager ~ ~ ~ {VillagerData:{profession:weaponsmith,level:5,type:swamp},Invulnerable:1,Silent:1,NoAI:1,CustomName:'{"text":"Bounty Board"}',Offers:{Recipes:[{buy:{id:"minecraft:arrow",Count:1b,tag:{display:{Name:'{"text":"hercules bow"}',Lore:['{"text":"This item is one of a kind"}']}}},sell:{id:"minecraft:diamond_block",Count:1b},rewardExp:0b,maxUses:1}]}}
I noticed that the dropped weapon had 3 tags so the villager trade wouldn't work how do I add this to the villager or remove from the mob drop
/summon spider ~ ~1 ~ {Passengers:[{id:skeleton,PersistenceRequired:1,HandItems:[{Count:1,id:bow,tag:{Enchantments:[{id:unbreaking,lvl:3},{id:power,lvl:5},{id:punch,lvl:2},{id:flame,lvl:1},{id:infinity,lvl:1}]}},{Count:1,id:bow,tag:{display:{Name:"\"hercules bow\"",Lore:["\"This item is one of a kind\""]}}}],ArmorItems:[{Count:1,id:netherite_boots,tag:{Enchantments:[{id:protection,lvl:4},{id:frost_walker,lvl:2},{id:binding_curse,lvl:1},{id:unbreaking,lvl:3},{id:vanishing_curse,lvl:1}]}},{Count:1,id:netherite_leggings,tag:{Enchantments:[{id:protection,lvl:4},{id:thorns,lvl:3},{id:binding_curse,lvl:1},{id:unbreaking,lvl:3},{id:vanishing_curse,lvl:1}]}},{Count:1,id:netherite_chestplate,tag:{Enchantments:[{id:protection,lvl:4},{id:binding_curse,lvl:1},{id:unbreaking,lvl:3},{id:vanishing_curse,lvl:1}]}},{Count:1,id:netherite_helmet,tag:{Enchantments:[{id:protection,lvl:4},{id:binding_curse,lvl:1},{id:unbreaking,lvl:3},{id:vanishing_curse,lvl:1}]}}],CustomName:"\"hercules\"",HandDropChances:[0.0f,1.0f],ActiveEffects:[{Id:11,Amplifier:0,Duration:999999},{Id:12,Amplifier:0,Duration:999999},{Id:21,Amplifier:0,Duration:999999},{Id:22,Amplifier:0,Duration:999999}]}]}
Pictures about "How to add a tag for a villager trade"
How do you get a villager that trades a name tag?
Name tags can now be bought from librarian villagers, at 20\u201322 emeralds for 1 name tag.Is there a command to give a villager a specific trade?
First, you need to program the command block to summon a villager with the /summon command. This /summon command will be run each time the command block is activated. So, stand in front of the command block with your pointer (the plus sign) on the command block and click on the right mouse button.Setting up CUSTOM TRADES in Vanilla Minecraft 1.17! (Part 1)
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Karolina Grabowska, Karolina Grabowska, Karolina Grabowska, Karolina Grabowska