The bug
When using whatever container that automatically updates the contents of a slot (like a furnace) and if the player, with the container GUI open, is constantly moving items into the inventory, the player won't see the container slot update (like a raw steak being cooked).
How to reproduce
Open the furnace gui
Place charcoal/coal and keep some item in your inventory
Place something to be cooked into the furnace
When the progress bar is almost at the end, start continuously left clicking an item in the inventory
What should happen is that the item to be cooked doesn't update (if it doesn't happen the first time, just retry), the progress bar has finished, and you won't have any item in the output slot, but if you click in it you will get the item cooked.
This also occurs with the /replaceitem
command:
How to reproduce
Put a command block on a clock, with a command such as:
/replaceitem entity @p inventory.0 golden_apple
→ This will put a golden apple in the first slot of your inventory
Open your inventory, and move the golden apple to another slot
As soon as a new one appears, grab it and move it to another slot as well
→ If you got the timing right, the slot will appear blank, even though the command block output in the chat window continues to say "[@: Replaced slot 9 with 1 x [Golden Apple]]"Turn off the clock
Exit the world
Re-enter the world, and open your inventory
→ There will be a golden apple in the first slot
Why this happens:
This happen because there's a boolean in EntityPlayerMP
that's set to true when the server receives a window click packet and then there the function that should send the slot updates is called, though if this boolean is true it will not send the packet to the client to update it (while the server-side thinks from the next update on that the client has received the update).
Basically if the server code updates the content of some slots in the container (raw food to be removed, output slot set to cooked food) while the player is moving other items in the inventory.. it won't get the update.
So one way to fix this would be to know which slot is getting modified by player and block the updates only for that slot and not all the container slots. Another way would be having a resend list where clients that didn't got a certain slot update, get a resend of the packet from the server.
Linked issues
relates to 1
Attachments
Comments 21


Is this still a concern in the latest Minecraft version 14w30c? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
I've updated the affected version because the problem is still present in 14w30c, the bug is reproducible in the same way.

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.
Well i have to say that it still happens but in a corner case.
Basicly if the output slot is empty, it all works.
Though if there's already an item and another is in the way and if 2 seconds before that item arrives (cooks if its a furnace) you start moving quickly stuff in the inventory, you won't see the stack number updating, so it seems there's only one item. And you can do this for every new item, so that maybe you finally click on the output and receive 10 items.
Now, i don't know if it's worth updating the affected version, i mean.. this is a very corner case ^^.
it appears a lot in snapshots 1.15 but also in some versions 1.14
This bug still present in 1.16.1?
Yes, still the case; Put this in a repeating command block:
replaceitem entity @p hotbar.8 stone
and pick up the item a couple of times, at one point, the client will no longer see an item, but an item is in fact there.
Still in 1.16.3.
I could recreate a similar bug in 1.17.1 with a function on tick
execute as @a[team=blue,nbt=!{Inventory:[{id:"minecraft:tnt"}]}] if score Aqua tnt matches 1.. if score match match matches 2 run function tntbattle:tnt-blue
give @s minecraft:tnt 1
scoreboard players remove Aqua tnt 1
Confirmed.