Skip to content

Fix Human movement by restoring the body rotation tick - #4301

Open
avaruus1 wants to merge 1 commit into
SpongePowered:api-18from
avaruus1:fix/human-entity-movement
Open

Fix Human movement by restoring the body rotation tick#4301
avaruus1 wants to merge 1 commit into
SpongePowered:api-18from
avaruus1:fix/human-entity-movement

Conversation

@avaruus1

Copy link
Copy Markdown
Contributor

Human written part of the description:

We noticed weird movement with human entities during API-14 -> API-18 upgrade and this resolves the issue.

I also tried removing the tickHeadTurn override completely, but this in turn caused the human head <-> body rotation to desync. (the yaw rot of the two could differ 180°)


The 25w02a update (ac2bbe5) adapted HumanEntity to Mojang's new tickHeadTurn(float) signature but dropped the super call in the process. Mob.tickHeadTurn is solely bodyRotationControl.clientTick(), which is the only thing that ever writes yBodyRot, so the Human's yBodyRot was frozen at its spawn value.

Since LookControl clamps yHeadRot to within getMaxHeadYRot() of yBodyRot while navigating, and this override copies yHeadRot onto yRot (the vector moveRelative steers by), the movement direction was pinned to a cone around that stale angle and MoveControl's steering was overwritten every tick. Humans walked into walls, moved sideways, and oscillated between two blocks.

The 25w02a update (ac2bbe5) adapted HumanEntity to Mojang's new
tickHeadTurn(float) signature but dropped the super call in the process.
Mob.tickHeadTurn is solely bodyRotationControl.clientTick(), which is the
only thing that ever writes yBodyRot, so the Human's yBodyRot was frozen
at its spawn value.

Since LookControl clamps yHeadRot to within getMaxHeadYRot() of yBodyRot
while navigating, and this override copies yHeadRot onto yRot (the vector
moveRelative steers by), the movement direction was pinned to a cone
around that stale angle and MoveControl's steering was overwritten every
tick. Humans walked into walls, moved sideways, and oscillated between
two blocks.
@avaruus1
avaruus1 force-pushed the fix/human-entity-movement branch from 2f82320 to 28ea0b6 Compare August 13, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants