mojira.dev
MC-1580

Ghost Items from Trading with SHIFT-click

If a player try to buy items from the villagers with SHIFT-click, he/she will get the correct number of the items. After the trading window closed, some emeralds pop-out and some of the items become "ghost" items. It will be replaced by other items from trading, or just disappear after the player re-enter the game. I've tested this in Minecraft 1.4 without any mods.

Linked issues

Attachments

Comments 14

I confirm this bug.
If i trade with "shift"-click, i buy goods for all the emeralds that i gave to villager. And after trading my emeralds fall from me to ground and at my inventory i have only a small part of purchased goods.

Since in 12w50a, Villagers were supposed to be able to sell Enchanted Books, I went around trading with Priests (they seemed most likely to have it) to see if I could have it pop up. During this, I noticed I was dropping my emeralds when I shift-clicked. I was confused, so I started counting. A villager wanted 1 emerald for 3 redstone. I gave the villager 25 emerald and received 75 total redstone, which is the correct number. When closing the GUI, I dropped 19 emerald. When I tried to click the redstone in my inventory, most of it simply disappeared. Frustrating, odd bug. Voted up.

Edit: This still exists in Snapshot 12w50b, as well as versions in between. As such, the affected versions should be updated to cover these versions, please.

This bug still exists in Minecraft 1.4.6 Pre-release. Affected versions should be updated to reflect this.

Just tested in Minecraft 1.4.7 Pre-release. Confirmed to still be present. Not that it wasn't expected, considering how specific the fixes were.

Edit: I think I figured it out. The way the game cancels out trades when the trade locks isn't complete. The client can trade as much as possible, but the server won't. As such, the client creates ghost items which much be manually corrected. Furthermore, the client loses access to the emeralds until they leave the trade and the server causes them to drop the items. The client needs to treat trades the same way as the server so you only trade to a certain amount.

Confirmed to still exist in Snapshot 13w01b.

4 more comments

It works perfectly fine for me in 1.6.2, 1.6.4, and 13w38c. What happens is when you shift-click the items (both from the trade and remainders of the unused that were not multiples) out of the trading grid, the items will auto-adjust in your inventory, even before pressing ESC. I have been trading this way for a while, and have never encountered ghost items.

How to test it:
1. Spawn a villager
2. Obtain 64 of whatever item(s) it wants for the trade
3. Place the whole stack into the trading window
4. shift-click the items out of the slot on the right, then remove any leftovers from the left.

The amounts will automatically adjust. You can see this by keeping an eye on the amounts of each item in your inventory. This is easier to see by getting a trade where you give emeralds and receive items, not as well the other way around.

Seems fixed in 14w04b

you can close immediately after trading and you get the items and the emeralds drop out (item duping)

Neko

(Unassigned)

Community Consensus

Minecraft 1.4.2, Minecraft 1.4.6, Snapshot 13w01b, Snapshot 13w09c, Minecraft 1.5.1, Snapshot 13w16b, Snapshot 13w17a, Minecraft 1.6.1, Minecraft 1.6.2

Minecraft 14w04a

Retrieved