mojira.dev
MC-34943

/summon-ing a villager without a "Count" tag allows the trade, but does not take the item

When you spawn in a villager with no "Count" tag in buy/buyB, you are able to trade with that villager without costing anything. You will need to put the item in the trade slots, but when completing the trade, the items aren't taken.

It seems the "Count" tag is defaulting to 0, although it should really be defaulting to 1. Mods reading this, if you flag it as "working as intended" I understand since spawning in a villager with a "Count:0" tag results in the same thing.

Anyways, here is the commands I used to test this. You will need to put them into a command block:

/summon Villager ~ ~1 ~ {Health:0.1f,Offers:{Recipes:[{buy:{id:"stone",Count:0b},sell:{id:"dirt",Count:1b},maxUses:2147483647,uses:0}]}}

Edit: Updated command to 16w05a

EDIT AS OF 13w03b:
Now it allows the trade, doesn't eat the item, but the item that it gives is a ghost item. When updated, the item just disappears. I have the villager trading a potion and it just disappears when you try to drink it.

I've also tried giving the potion a count tag of 1 and the same thing happens. (if I could figure out how to cross through this I would): I put the count in the wrong place when testing this. If there is a Count:1 in the correct place in the sell tag, the item is a real item. Otherwise, it is a ghost item. This is a similar thing as the buy tag.

It does count as a trade; the villager eventually won't give any more trades and give xp for each trade done, but really there is nothing happening except that free xp and new trades.

Linked issues

Comments 12

Is this still a concern in the latest Minecraft version 13w48b? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

It is still in 13w48b actually. I totally forgot about this tbh; haven't been messing with villagers as much lately.

I think the option of spawning in at a count of 0 and having it react this way would still be a good thing, but a missing count tag should default it to 1.

Is this still a concern in the latest Minecraft version 14w02c? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

It does still happen in 14w03b, but has changed. Now it allows the trade, doesn't eat the item, but the item that it gives is a ghost item. When updated, the item just disappears. I have the villager trading a potion and it just disappears when you try to drink it.

I've also tried giving the potion a count tag of 1 and the same thing happens. (if I could figure out how to cross through this I would): I put the count in the wrong place when testing this. If there is a Count:1 in the correct place in the sell tag, the item is a real item. Otherwise, it is a ghost item. This is a similar thing as the buy tag.

It does count as a trade; the villager eventually won't give any more trades and give xp for each trade done, but really there is nothing happening except that free xp and new trades.

I'll update on the post itself.

Is this still a concern in the current Minecraft version 14w11b / Launcher version 1.3.11 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

2 more comments

Is this still a concern in the current Minecraft version 1.8.1 Prerelease 3 / Launcher version 1.5.3 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Confirmed for

  • 1.8.4 but probably also a "Won't fix" (see MC-48626)

Confirmed for

  • 16w05a but probably "Works as Intended"

Please remove the outdated example commands and add instead this one

/summon Villager ~ ~1 ~ {Health:0.1f,Offers:{Recipes:[{buy:{id:"stone",Count:0b},sell:{id:"dirt",Count:1b},maxUses:2147483647,uses:0}]}}

Fixed for 16w32b (now the villager neither show the stone, nor give you dirt for it)

Void_Concept

(Unassigned)

Community Consensus

count, tag, trading, villager

Minecraft 13w41b, Minecraft 13w48b, Minecraft 14w21b, Minecraft 1.8.4, Minecraft 1.8.9, Minecraft 16w05a

Minecraft 16w32b

Retrieved