How do I give a villager trades with custom NBT tags [duplicate]
I want to make a special villager that will trade a custom structure block upon the given items. I don't know how to get a villager to trade items with NBT tags though. What would I do with this example:
/summon Villager ~ ~ ~ {Profession:0,CustomName:"Carpenter",CustomNameVisible:0,Career:4,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,Silent:1,Invulnerable:1,Attributes:[{Name:"generic.knockbackResistance",Base:"1f"},{Name:"generic.movementSpeed",Base:"0f"}],Offers:{Recipes:[{buy:{id:"stick",Count:8},buyB:{id:"wooden_pressure_plate",Count:1},maxUses:9999999,sell:{id:"structure_block",Count:1},rewardExp:false}]}}
From memory, you would add ,tag:{whatever}
after the Count:1
near the end of your command. The "whatever" would be the tags you want.
/summon Villager ~ ~ ~ {Profession:0,CustomName:"Carpenter",CustomNameVisible:0,Career:4,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,Silent:1,Invulnerable:1,Attributes:[{Name:"generic.knockbackResistance",Base:"1f"},{Name:"generic.movementSpeed",Base:"0f"}],Offers:{Recipes:[{buy:{id:"stick",Count:8},buyB:{id:"wooden_pressure_plate",Count:1},maxUses:9999999,sell:{id:"structure_block",Count:1,tag:{whatever}},rewardExp:false}]}}