What I wanted to make was a villager that depending on what other actions you do (let's simplify that to clicking buttons) gets extra trades. I figured out how to set the trades of a villager:

/entitydata @e[type=Villager] {Offers:{Recipes:[{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:diamond,Count:1},buyB:{id:emerald,Count:5}}]}}

But I cannot figure out how to add a trade to this without removing, or having to re-specify this trade, add another trade to this villager. Is there a way of doing this?


It makes it harder that you're using /entitydata, but try using the /summon command:

/summon Villager ~1 ~ ~ {Profession:0,CustomName:"[VillagerNameHere]",CustomNameVisible:1,Career:1,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,Invulnerable:1,Offers:{Recipes:[{buy:{id:"diamond_sword",Count:1},maxUses:9999999,buyB;{id:emerald,Count:5},sell:{id:"[put item you want to sell here]",Count:1},rewardExp:false}]}}
  • 1
    Are you generating another villager for another trade? – l4m2 May 13 '18 at 5:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.