mojira.dev
MC-95308

Custom Villager Sells Item From Non-Specified Entries

So I have been trying to make a custom villager, which takes an item for exchange and offering a separate item... totally not working properly. The code can be found below.

It looks fine to me, however, the Villager will sell you the item from the SECOND selection, if you offer the correct item in exchange placing it into the FIRST selection. The FIRST selection has no entries for buy or sell... so why is it able to sell an item not defined within its parameters? It is pulling the item from the SECOND entry and offering it in both slots, even without showing the item in the FIRST entry.

Code is as follows....

/summon Villager ~ ~1 ~ {
Profession:0,
CustomName:"Why Wont This Work",
CustomNameVisible:1,
Career:2,
CareerLevel:42,
CanPickUpLoot:0,
PersistenceRequired:1,
Invulnerable:1,
Offers:{
Recipes:[
{buy:{},buyB:{},sell:{}},
{buy:{
id:"paper",
Count:1,
tag:{
display:{
Lore:["Ticket",
"Custom Ticket"]}
}
},
maxUses:9999999,
sell:{
id:"leather_helmet",
Count:1,
rewardExp:false}}]}}

So notice the first entry has {buy:{},buyB:{},sell:{}} listed... yet, can still purchase an item from this slot.... why?

Comments 4

Cause this command is not proper. Use this instead:

/summon Villager ~ ~1 ~ {Offers:{}}

Other offers will be used if the inserted items don't match the selected offer.

Huh? Why would it pull other items if something doesn't match? I'm pretty sure this is bugged.
Also, it only does this on the first entry. If you have 10 items on the NPC, only the first entry bugs out like this.

*edit*

You are correct about the offer being given matching the first trade available for that item... however, why does this only happen in the first entry for the Villager... it just, doesn't seem right... but if that's how it works, I guess that's how it works.

Why would you want an empry trade? It's just useless. The game just sees it has a trade but doesn't see the items, thus fills in the items. If it doesn't it might cause the game to crash. If you don't want that trade, just remove it from the list, as empty trade recepies are useless in general and won't work.

CJ

(Unassigned)

Unconfirmed

Minecraft 1.8.9

Retrieved