I would like to add animations to my pengiun. No cutsom animations just standard walk and look arround. But I don't know how to do it. I only saw videos for Minecraft 1.16 and the code from those videos doesn't work in 1.19 (I'm a beginner by the way).
This is my code for the animation right now:
@Override
public void setupAnim(PenguinEntity p_102618_, float p_102619_, float p_102620_, float p_102621_, float p_102622_, float p_102623_) {
float f = p_102621_ - (float)p_102618_.tickCount;
float f2 = 1.0F;
this.body.xRot = ((float)Math.PI / 2F) * (float)Math.PI * 0.35F;
this.body.y = 9.0F * f2 + 11.0F;
this.Right_Leg.xRot -= (float)Math.PI * 0.45F;
this.Left_leg.xRot -= (float)Math.PI * 0.45F;
if (this.young) {
this.head.y = 10.0F * f2 - 9.0F;
this.head.z = -16.0F * f2 - 7.0F;
} else {
this.head.y = 10.0F * f2 - 14.0F;
this.head.z = -16.0F * f2 - 3.0F;
}
this.head.xRot += (float)Math.PI * 0.15F;
}
it almost works, but the feet turn all the time and the head is far away from the model and also turns all the time.
can some one help me please?