How can I summon a villager that sells nothing for something?



  • I want to summon a villager that sells nothing when you sell to him something. For example:

    /summon Villager ~ ~1 ~ {Silent:1,NoAI:1,Offers:{Recipes:[{maxUses:1,buy:{id:"minecraft:flint",Count:1},sell:{id:"",Count:0,Damage:0}}]}}

    So when I sell him flint, I will get nothing in return. The only problem is whenever I make the trade, my game crashes. The only way I can really think of doing this is by selling a random item (Like TNT) and have a command block on a clock clear that item. But I would rather to use that as a last resort. Any help would be great. Thanks.



  • You cannot set empty NBT tag nor set something to zero count.

    Make it another way - Sell two items and let him give you back the one of it - "renewable token".

    So you will sell "anything" + "item you want to sell" , and get "anything" back. Yup, you just lost that thing you wanted to get rid of.

    /summon Villager ~ ~1 ~ {Silent:1,NoAI:1,Offers:{Recipes:[{maxUses:7,buy:{id:"minecraft:flint",Count:1},buyb:{id:"minecraft:stone",Count:1},sell:{id:"minecraft:stone",Count:1}}]}}
    

    PS: buyb is the second buy tag, as I remember, cannot check now from work 🙂




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2