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

Side crossing causing inconsistent knockback behaviour between single player and servers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.18.2, 1.19, 1.19.1 Pre-release 1
    • None
    • Plausible
    • Player
    • Normal
    • Platform

      I had always been wondering why taking fall damage on servers causes your movement to stall in midair, so I did some investigating, as it turns out, when the server is managing the player's movement, there would be a difference in behavior between local server and remote servers.

      Facts

      1. Player receives knockback from server via `ClientboundSetEntityMotionPacket`

      2. When the client receives the packet for the local player, it sets the player's motion/delta movement to the Vec3 in the packet

      3. The Vec3 in the packet is determined by the motion/delta movement the server has of that player.

      Issue:

      The server code crossed sides to access the LocalPlayer's motion on singleplayer, while it can't on multiplayer.

      Ramification:

      On single player, any knockback is added to the player's original motion(Only the host if it's opened to LAN), but on multiplayer, the knockback replaces the player's original motion.

       

      Proposed solution:

      1. Add a different packet for player knockbacks

      Not recommended solutions:

      1. Make the client report motion data to server (But it could open up new a creative uses)
      2. Change how ClientboundSetEntityMotionPacket is handled and add the motion instead of setting.

      also you should fix the side crossing

            Unassigned Unassigned
            shuaiouke shuaiouke
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: