Topic category: Feature requests and ideas for MCreator
i tried it and it’s worked but it’s takes a long time so i want it to be in mcreator
Okay, I did this for an elephant mob -- it will rear up on the first attack.
First you need to create a couple fields in your entity class. I used a boolean called isRearing and an int called rearingCounter (this will control the animation).
When the entity attacks you set the isRearing = true, and rearingCounter to number of steps in your animation (minus one).
Then in your model class, when you set the rotation angles, check the entity's isRearing and change the angles depending on where you are in the animation (based on rearingCounter which you will also decrement). When rearingCounter < 0 then set isRearing to false since you're done with the attack.
The trouble though is that the model class is running on the client but the attack code is running on the server. So you also need to create a custom packet to indicate the attack started. The packet doesn't really need any information in it, just needs to have id that is recognized that it is indicating that an attack started. When the client receives this packet, it also sets the isRearing to true and the rearingCounter to the number of the steps in your animation (minus one).
(could you do it pls)