Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-255058

AttackStrengthTicker desynchronization when swinging

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.2, 22w43a, 23w06a, 1.19.4, 1.20.1
    • None
    • Confirmed
    • Combat, Networking
    • Normal
    • Platform

      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

            Unassigned Unassigned
            Moulberry James Jenour
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: