mojira.dev
MC-312035

Attacking an entity in Creative mode, then switching to Survival mode adds 5 ticks of block break delay

When attacking any entity in creative mode then switching to survival after any amount of time, it will take 5 additional ticks to break the first block after switching to survival mode.

Code analysis:
The last if statement (including body) in the MultiPlayerGameMode::attack method was newly added in 26.3:

public void attack(final Player player, final Entity entity) {
      this.ensureHasSentCarriedItem();
      this.connection.send(new ServerboundAttackPacket(entity.getId()));
      player.attack(entity);
      player.resetAttackStrengthTicker();
      if (player.getAbilities().instabuild) {
         this.destroyDelay = 5;
      }
   }

The destroyDelay field doesn’t seem to do anything in creative mode and it also doesn’t decrease every tick, but instead only decrements when the player tries breaking a block in survival or adventure mode.

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

This issue has been reviewed by our team.

Please add new, relevant information if it helps us understand or reproduce the issue. To show that you’re affected, use the vote feature rather than commenting.

If a fix is implemented, it will be listed in our official changelogs.

For major outages or urgent assistance, visit the Minecraft Help Center.

Z0rty

(Unassigned)

1694232

Confirmed

Expansion A

Normal

Player

26.3

26.4 Snapshot 2

Retrieved