I have a sphere entity which i want to be able to rotate on the x and y axis from a script. I figured out the script API part - i'm using the entity.setRotation() function which is described as modifying The x and y rotation of the entity. For most mobs, the x rotation controls the head tilt and the y rotation controls the body rotation.
The problem is i can't figure out which queries to use in the animation file to get the rotation from that function.
This is currently my animation file:
{
"format_version": "1.8.0",
"animations": {
"animation.sphere.roll": {
"loop": true,
"bones": {
"root": { "rotation": [ "query.head_x_rotation(0)", "query.head_y_rotation(0)", 0 ] }
}
}
}
}
Right now, I call the setRotation() function when the entity is spawned, and the sphere seems to correctly rotate on the y axis (interpolated), but on the x axis it interpolates to the angle i gave it (45°) and then immediately goes back to 0, making a sort of bobbing motion, once.
Any idea how to fix this?