[MC-4024] Chest glitch - Server/Client desync Created: 01/Dec/12  Updated: 03/Apr/18  Resolved: 13/Dec/12

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.5
Fix Version/s: Snapshot 12w50b

Type: Bug
Reporter: Aikar Assignee: [Mojang] Jeb (Jens Bergensten)
Resolution: Fixed Votes: 2
Labels: chest
Environment:

n/a


Attachments: PNG File 2012-10-27_17.25.58.png     PNG File 2012-10-27_17.26.02.png     PNG File 2012-11-02_16.40.18.png    
Issue Links:
Cloners
clones MC-515 Chest glitch that lets them appear as... Resolved
Duplicate
is duplicated by MC-7328 I get or lose items i put in or out a... Resolved
is duplicated by MC-88 Chest lag making the game almost impo... Resolved
is duplicated by MC-376 Disapearing Items Resolved
is duplicated by MC-514 chests don't work properly Resolved
is duplicated by MC-576 Double chest stays open after interac... Resolved
is duplicated by MC-781 Items stored in one chest reappear in... Resolved
is duplicated by MC-1116 Undoing interaction with items in the... Resolved
is duplicated by MC-1638 Chest closing sound plays while you h... Resolved
is duplicated by MC-1640 Chests will close while chest menu is... Resolved
is duplicated by MC-1649 chest remains open when an iten is pi... Resolved
is duplicated by MC-1738 Chest getting stuck in the open close... Resolved
is duplicated by MC-1792 Chest Problem Resolved
is duplicated by MC-1826 Chests not closing their lids after b... Resolved
is duplicated by MC-1827 Chests not always closing after being... Resolved
is duplicated by MC-1886 Newly placed double chests automatica... Resolved
is duplicated by MC-1909 Chest lid closing when still browsing... Resolved
is duplicated by MC-1911 Chests dont close after opened Resolved
is duplicated by MC-1951 Taking items from chests become ghost... Resolved
is duplicated by MC-2055 Chest Keeping open issue is now in si... Resolved
is duplicated by MC-2095 the chest not closed Resolved
is duplicated by MC-2211 Chest Items Disappear Resolved
is duplicated by MC-2267 Chest Animation Bug Resolved
is duplicated by MC-2694 Chest Bug Resolved
is duplicated by MC-4960 chest glitch Resolved
CHK:
Confirmation Status: Confirmed
Game Mode: Survival

 Description   

Cloning to reopen as this is not fixed in 1.4.5, as the animations can still show this same behavior as reported in this ticket, but there is more damages than the animations alone that I feel previous reporters likely missed and didn't understand the 2 were related.

----------------
Better Description
----------------
If a user manages to right click a chest 2 or more times before the server has registered it and sent the user the Container Open packet, the user chest the server thinks the user has open will be the first click, where as the client will think its the second click.

This causes the server to ignore everything the user does with that chest, so any items pulled out will stay in the chest, and any items put in will stay in players inventory.

As previously reported, the chest animations get into an inverted state.

This is 100% reproduceable by simply disabling your internet connection while on SMP, click the chest 2+ times, reenable internet.

The server will catch up to your packets once your internet reconnects and trigger the issue.

For players on slower network connections, this happens accidently often, causing lots of confusion on why their items are not where they put them.

Confirmed in 1.4.5 Vanilla and Craftbukkit. This issue has existed since 1.3.1

----------------
Original Description
----------------

This happens from time to time when playing SMP with a friend on my local minecraft server.

The chest seems to remain on the open state (regarding the animation) and closes once I rightclick it to view its inventory, so basically it's inverted. The issue doesn't seem to resolve itself after relogging, so it must be a server-side issue.

It usually happens after playing for a while, after frequently using a chest. Have been able to reproduce this for a few times, so I'll provide a screenshot whenever it happens again.



 Comments   
Comment by [Mojang] Jeb (Jens Bergensten) [ 13/Dec/12 ]

Thanks for the detailed bug report! I was able to reproduce and fix it, turned out the client responded with a "close container" packet when it received one, so the server would close two containers when the client only closed one.

Comment by Chloe Idun Anderson [ 06/Dec/12 ]

Why not just make the client ignore right clicks after you right click a chest until it gets a response from the server? And, if this is really the cause of the bug they say that causes items not to shift around I imagine it probably affects all containers, so why not just make it do this for all containers.

In other words, the client says, "A chest was just right-clicked." and tries to send the packet to the server, until the server responds the client just ignores all subsequent right clicks.

Comment by Rolf Redford [ 06/Dec/12 ]

Interesting. Bug appears if 2 persons use chest at same time. My bro clicked chest, I went in, deposited stuff and left to make more stuff. My bro finished and left and chest top was still up.

Maybe some sort of counter is needed. If browsing users is >= 1, lid stay up?

Comment by Xerca [ 06/Dec/12 ]

This (when you think an item is taken/placed but it actually isn't) happened to me lots of times and it is really annoying when I don't notice it soon after, but I'm not sure if that happened when I clicked more than once on the chests. I hope this is the only bug that causes this.

Comment by adam giraudet [ 04/Dec/12 ]

this happens more often on slower computers when the game lags trying to run the movement and causes the player to do the accidental double click and causing this glitch

Generated at Sun Jan 12 12:03:11 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.