mojira.dev

Eevee17_

Assigned

No issues.

Reported

Comments

This bug does not affect shulker boxes (another container with an opening/closing animation).

There is a difference in Minecraft's code (simplified) between the affected containers (chests and barrels) and shulker boxes:

Affected containers:

useWithoutItem(Level, Player, /*...*/) {
  if (Level.isClientSide) {
    return SUCCESS; // player opened the container
  } else {
    //...
  }
}
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 {
    //...
  }
}
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;
}
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.