Skip to content

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

Merged
aromaa merged 1 commit into
SpongePowered:api-17from
avaruus1:fix/human-entity-movement
Aug 26, 2026
Merged

Fix Human movement by restoring the body rotation tick#4301
aromaa merged 1 commit into
SpongePowered:api-17from
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.

@avaruus1
avaruus1 force-pushed the fix/human-entity-movement branch from 2f82320 to 28ea0b6 Compare August 13, 2026 22:34
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 28ea0b6 to 47c48f7 Compare August 26, 2026 13:22
@avaruus1
avaruus1 changed the base branch from api-18 to api-17 August 26, 2026 13:22
@aromaa
aromaa merged commit d58d231 into SpongePowered:api-17 Aug 26, 2026
7 checks passed
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.

3 participants