Mojira Archive
MC-252140

Side crossing causing inconsistent knockback behaviour between single player and servers

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

Unresolved

shuaiouke

2022-05-24, 11:51 AM

2023-08-02, 06:34 PM

5

4

Plausible

Normal

Platform

Player

1.18.2, 1.19, 1.19.1 Pre-release 1

-