Posted January 16, 20187 yr In 1.9-- you use getTicksSincelastAttack but things changed and I don't know how anymore. // TODO: find better attack animation method int ticksSinceLastAttack = dragon.getLastAttackedEntityTime(); boolean jawFlag = (ticksSinceLastAttack >= 0 && ticksSinceLastAttack < JAW_OPENING_TIME_FOR_ATTACK); jawTimer.add(jawFlag ? 0.2f : -0.6f); jawTimer.set(0.0F); When I use the code above it just open closes the mouth of the dragon even when not attacking.
January 17, 20187 yr Author If no one cant understand unless tell me how other mobs use animations when attacking, show me where the classes where their animations are handled.
January 17, 20187 yr Well, you can easily just create a counter yourself. Set it when the entity attacks, decrement it each tick in an update method, and us it in the render or model code to rotate the mouth or other thing you want to animate. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.