The bug
When a skeleton is strafing, their body doesn't rotate to the direction it's moving whereas players bodies rotate to the direction they are moving.
How to reproduce:
Spawn a skeleton and wait for it to target you
See that when it strafes, its body always faces you but it is supposed to rotate sideways because players bodies face sideways when they walk side to side
Linked issues
relates to 1
Attachments
Comments 7
Can confirm in 23w51b. A similar behavior was observed for the mobs on a larger scale attribute.
[media]I messed around a bit with the code for body rotation, and seems that it might be caused by the fact that when entities are moving, their body seems to always line up with their head.
Not sure why they added that, but it seems to be the case since the 1.2 AI update given how entity backwards animation was only changed in 1.14 but already disappeared for mobs during the 1.2 and 1.8 AI overhauls.
(Based on 1.20.4, Mojang Mappings)
The issue may be due to this code in net.minecraft.world.entity.ai.control.BodyRotationControl
public void clientTick() {
if (this.isMoving()) {
this.mob.yBodyRot = this.mob.getYRot();
...
}
...
}
When the mob moves, it always lines up the body with the head rotation (since it is usually the same as the general rotation of the mob), but when skeletons strafe, their head faces the player, thus their body lines up with the head and faces the player despite strafing sideways.
Thank you for your report!
However, this issue is Incomplete.
Your report does not contain enough information. As such, we're unable to understand or reproduce the problem.
Please review the guidelines linked below before making further reports.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki