-
Bug
-
Resolution: Duplicate
-
None
-
1.21
-
None
-
Unconfirmed
-
Spectator
-
Block states, Player
(I will refer to chests and barrels as 'affected containers')
If a player who is not in spectator mode closes an affected container that has the open animation while a player in spectator mode is viewing the contents of said affected container, that affected container keeps its open animation until the player in spectator mode closes the container.
The attached video demonstrates how to replicate this bug.
This bug does not affect shulker boxes (see below).
Difference in Minecraft's source (simplified) between affected containers and shulker boxes:
Affected containers:
useWithoutItem(Level, Player, /*...*/) { if (Level.isClientSide) { return SUCCESS; // player opened the container } else { //... } }
Shulker box (unaffected):
useWithoutItem(Level, Player, /*...*/) { if (Level.isClientSide) { return SUCCESS; // player opened the container } else if (Player.isSpectator()) { return CONSUME; // player is in spectator mode, so they didn't actually open the container } else { //... } }
Shulker boxes have the following code (simplified) that checks if they are in spectator mode and removes the interaction while the affected containers do not:
else if (Player.isSpectator()) { return CONSUME; }
Potential Fix: Adding the code that I highlighted from the shulker box to the affected containers' code might fix the bug.
- duplicates
-
MC-232968 Spectators can prevent the closing animation of a chest/barrel when viewing it at the same time as a non-spectator
- Open