mojira.dev
MC-120955

Skeletons body doesn't rotate like players when strafing

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:

  1. Spawn a skeleton and wait for it to target you

  2. 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

Attachments

Comments 7

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

Just like the player's body, the skeleton's body is not rotated when walking backwards. (1.12.2)

@unknown sideways, not backwards.

Can confirm in 20w48a.

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.

Greg Milson

(Unassigned)

Confirmed

Mob behaviour

body, rotation, skeleton

Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, ..., 20w10a, 1.16.4, 20w48a, 1.20.2, 1.20.4

Retrieved