animated attack animate

Started by Red Tofu on

Topic category: Feature requests and ideas for MCreator

Last seen on 09:12, 16. Jan 2024
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
animated attack animate

i tried it and it’s worked but it’s takes a long time so i want it to be in mcreator

he said

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).

 

That's it.

(could you do it pls)

 

 

Last seen on 23:19, 22. Jan 2021
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you pass the code you…
Mon, 07/20/2020 - 22:49

Can you pass the code you made? PLEASE!!