How to add attack animations [TUTORIAL]

Started by Red Tofu on Thu, 05/27/2021 - 17:39

Topic category: Help with modding (Java Edition)

Last seen on 03:42, 31. Jul 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to add attack animations [TUTORIAL]
Thu, 05/27/2021 - 17:39

Hi guys. I am the creator of THE UNDEAD mod

Today, i am going to teach you how to add custom animations.

1.Model

First you need to look for your mob part default rotation.

1f = 18 degree

2.Trigger

You can use mobs trigger that returns [TRUE] or [FALSE] any trigger you wanted to use.

3.Make a Trigger

This is an example of attacking trigger.

The more ticks you add the more slower the attack.

4.adds custom codes

Do this in mob render.

This won't work if the specific parts already have thier own movements.


[This is an example of mob swinging thier rightArm]

First,You need to add varieble of default rotation of model parts.

In the picture i named my varieble to [A]

---------------------------------------------------------------------------------------------

float A=5.0f; [Default rotation]
            if(e.isSprinting()==true){   [Your Trigger is true]
                   this.rightArm.rotateAngleX = f2;   [f2 means it will loops back] [f means instantmovement and won't loop back]
                   A=3.2f; [Movement value change]
            }
            else{    [If it's not true]
                   this.rightArm.rotateAngleX = 5.0f; [Default rotation]
                   A=5.0f;   [Default rotation]
            }

--------------------------------------------------------------------------------------------

[You can remove else in make have a new perm pose]

You can also try other triggers and procedures and import it inside.

------------------------------------------------------------------------------------------------

EXTRA:Double Movement

This will work if the specific parts already have thier own movements.

When your mobs already have there own movement but it can also swing there arms.

all you need to do is add your varieble into the movement animations(I have no simple explanations).

 

My eng may bad but i want to put my effort on helping other modders ;D

 

*THANKS HAVE A GOOD DAY MODDING MCREATOR*

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Last seen on 02:09, 12. Jul 2021
Joined May 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thank you!
Thu, 05/27/2021 - 17:43

Thank you!

Last seen on 08:28, 28. Jul 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks
Thu, 05/27/2021 - 17:48

thanks