mojira.dev
MC-274944

Spectators Keep Chests and Barrels Open

(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.

Linked issues

Attachments

Comments 1

Thank you for your report!
We're tracking this issue in MC-232968, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Eevee17_

(Unassigned)

Unconfirmed

Block states, Player

1.21

Retrieved