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

Swing packet sent to client sends one back to the server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.1
    • None
    • Plausible
    • Networking
    • Normal
    • Platform

      When sending an arm swing/animation packet to the java client, it will send an arm swing packet back to the server even though the player didn't manually swing by clicking. This results in "fake" arm swing packets being sent to the server, causing inconsistencies whenever playing on servers with higher ping.

      Steps to reproduce (Check on a Paper jar server using a packet listener plugin to send and listen to packets):
      1. While on a server, send to the player a clientbound "Entity Animation" packet, with the entity ID as the player and the "Swing Main Hand" animation ID.

      2. If done properly, the player's client should show them swinging their arm, which will also send a "Swing Arm" serverbound packet to to the server as if the player client swung their hands by left clicking. You can check this using some sort of packet listener/checker on the server to see which packets are being received.

      Expected Behavior:

      When the clientbound animation packet is sent to the player, it should not send back a serverbound packet to the server, as those packets are usually handled as if the player trigger those themselves.

      Observed Behavior:

      It's observed that when sending the clientbound animation packet to the player, it sends back a serverbound swing arm packet to the server. This can cause issues when listening to this packet whenever you want to have the player do a fake swing that isn't a real input on their end.

            Unassigned Unassigned
            Novalescent Novalescent
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: