mojira.dev
MC-255263

Players' positions are desynced after stopping movement while moving the camera

The Bug:

Players' positions are desynced after stopping movement while moving the camera.

This bug regularly causes position desyncs on the client for every single entity. Gameplay will often not be impacted, but it can be visually jarring/confusing for players. This desync occurs due to the incorrect handling of ClientboundMoveEntityPacket which overrides previous lerp values.

https://youtu.be/da_hIu-LHPk

Steps to Reproduce:

  1. Get two players and label them "Player A" and "Player B".

  2. Get "Player A" to jump and move their camera as they're about to land, and have "Player B" watch them.

  3. After "Player A" has landed, have "Player B" watch and see if the position of "Player A" eventually updates and moves downwards slightly.

  4. Take note as to whether or not players' positions are desynced after stopping movement while moving the camera.

Observed Behavior:

Players' positions are desynced.

Expected Behavior:

Players' positions would not be desynced.

Potential Fix:

In the `hasRotation` branch of handleMoveEntity(ClientboundMoveEntityPacket), use the position tracked by the VecDeltaCodec instead of the entity's getX, getY and getZ methods.

Attachments

Comments 3

I can confirm this behavior.

[media]

This was fixed at some point in 1.20 during development of Display entities, but I cannot mark the bug report as fixed by myself

Added two videos: one demonstrating a fixed version (1.20.2-pre1), the other demonstrating a bugged version (23w35a).

Moulberry

(Unassigned)

Community Consensus

Platform

Normal

Networking

1.19.2, 1.19.4, 1.20 Pre-release 6

1.20.2 Pre-release 1

Retrieved