Set player head rotation

Hello,

I’m currently trying to set the player head rotation to a specific Vector3d, but only the yaw (y property of the vector) is set, the yaw does not change.

player.setHeadRotation(new Vector3d(pitch, yaw, 0));

Why this doesn’t work ?

Up !
Nobody knows ?

Whats the body rotation and head rotation value?

When I debug values, player.getHeadRotation().getX() (looks like it’s yaw) and player.getHeadRotation().getY() (pitch), the values correspond to what Minecraft gives in f3. It’s the same with player.getRotation().

Solved.
Juste use the method Player#setLocationAndRotation(Location<World> location, Vector3d direction).