I have the following script in my animation.js file:
function tick(entity, model) {
print(entity.getBodyYaw());
}
After equipping the model, I would suggest running /tp @s ~ ~ ~ 0 0 to properly reset your rotation. At that point, watching the console reveals extremely strange results. Turning a full 90 degrees to the right (and then punching, to reset the body yaw to match the head yaw) results in a value of around -8000. If you instead turn 90 degrees to the left, it once again outputs a value of -8000. I have not yet observed this function outputting any positive values. Additionally, the values it outputs don't appear to scale linearly - turning around 180 degrees outputs a value of around -32,000. A full 360 degree rotation outputs -130,000.
Running getBodyYaw() in the update function instead of the tick function seems to output roughly the same numbers, with the caveat that the exact value it outputs varies dramatically from frame to frame even if the player isn't rotating at all.
I have the following script in my animation.js file:
After equipping the model, I would suggest running
/tp @s ~ ~ ~ 0 0
to properly reset your rotation. At that point, watching the console reveals extremely strange results. Turning a full 90 degrees to the right (and then punching, to reset the body yaw to match the head yaw) results in a value of around -8000. If you instead turn 90 degrees to the left, it once again outputs a value of -8000. I have not yet observed this function outputting any positive values. Additionally, the values it outputs don't appear to scale linearly - turning around 180 degrees outputs a value of around -32,000. A full 360 degree rotation outputs -130,000.Running getBodyYaw() in the update function instead of the tick function seems to output roughly the same numbers, with the caveat that the exact value it outputs varies dramatically from frame to frame even if the player isn't rotating at all.