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

Client-server desync when player attacks while holding sprint key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.8-pre2, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.2-pre1, Minecraft 15w49a, Minecraft 15w49b, Minecraft 15w50a, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w04a, Minecraft 16w06a, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.10.2, Minecraft 16w43a, Minecraft 1.13.1, Minecraft 1.14.3 Pre-Release 1, 1.15.1, 1.16.1, 20w49a, 21w03a, 21w05b, 21w06a, 21w07a, 1.17.1, 1.18.2, 22w14a, 22w15a, 22w16b, 22w17a, 22w18a, 1.19.2, 22w42a, 22w43a, 22w44a, 22w45a, 22w46a, 1.19.3 Pre-release 1, 1.19.3 Pre-release 2, 1.19.3 Pre-release 3, 1.19.3 Release Candidate 1, 1.19.3 Release Candidate 2, 1.19.3, 23w03a, 23w04a, 23w05a, 23w06a, 23w07a, 1.19.4 Pre-release 1, 1.19.4 Pre-release 2, 1.19.4 Pre-release 3, 1.19.4 Pre-release 4, 1.19.4 Release Candidate 1, 1.19.4 Release Candidate 2, 1.19.4 Release Candidate 3, 1.19.4, 23w12a, 23w13a, 23w14a, 23w16a, 23w17a, 23w18a, 1.20 Pre-release 1, 1.20 Pre-release 2, 1.20 Pre-release 4, 1.20 Pre-release 5, 1.20 Pre-release 6, 1.20 Pre-release 7, 1.20 Release Candidate 1, 1.20, 1.20.1 Release Candidate 1, 1.20.1, 1.20.2, 1.20.4, 1.21, 24w36a, 1.21.2 Pre-Release 3, 1.21.3, 24w46a, 1.21.4
    • None
    • Confirmed
    • Combat, Networking
    • Normal
    • Platform

      If the player is holding the sprint key and attacks something (like a mob or other player), this will not interrupt their sprint, as it does with a double-tap sprint. However, the server assumes that this does interrupt the sprint, and the player's server state is changed accordingly. This results in a situation where the client thinks the player is sprinting and the server thinks they are not.

      One effect of this is that knockback distance is reduced, since that is calculated on the server. From the player's perspective, their first hit while sprinting will cause much more knockback than all following hits, until they restart their sprint. This is counter-intuitive, since the sprint could go on for any length of time, reducing knockback for no apparent reason, whereas restarting the sprint will instantly allow the extra knockback.

      Here is a video demonstration of the bug:
      https://www.youtube.com/watch?v=kp4h0O_YKYw#t=9m50s

      Any fix for this will change gameplay noticeably. Preserving the client behavior and fixing the server to stay in sync will make sprint knockback much more powerful. Changing the client to match the server means that sprinting will be interrupted when attacking, which players may consider regressive.

      Some possible compromises:

      • Fix the server to match the client, but reduce the sprint knockback bonus in general, to balance it out
      • Fix the server, and add a timed cooldown between sprint knockbacks
      • Fix the server, but use other factors to reduce knockback, such as the target's velocity and sprinting state

            Unassigned Unassigned
            SoloAlguien Solo Alguien
            Votes:
            40 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              CHK: