mojira.dev
MC-255058

AttackStrengthTicker desynchronization when swinging

Bug

Any swinging animation results in the AttackStrengthTicker being reset on the server, even if it isn't reset on the client. This desync can cause seemingly full attacks to deal minimum damage.

Vanilla Reproducer

Some ways of producing a swing that shouldn't reset the cooldown include (but are not limited to): interacting with a block, breaking a block, using an item from your off hand.

This video shows such cases triggering the desync: https://youtu.be/-ppiZNBVm9g

Importance

This bug causes big problems during combat, players will seemingly perform a full attack only for the attack to deal 0 damage.

Recommended Fix

Currently, it seems as though the only reason the AttackStrengthTicker is reset upon swinging is in order to reset it when the player misses (in Minecraft#startAttack). Therefore, doing the following would solve the issue:

  1. Make the client send a `ServerboundMissPacket` upon missing, which the server can use to reset the ticker

Linked issues

Attachments

Comments 1

Avoma

I can confirm this behavior.

[media]

Moulberry

(Unassigned)

Confirmed

Platform

Normal

Combat, Networking

1.19.2, 22w43a, 23w06a, 1.19.4, 1.20.1

Retrieved