Can i Make custom Mob animation Slower?

Started by Bronze on Wed, 01/01/2020 - 00:57

Topic category: Help with modding (Java Edition)

Last seen on 13:36, 6. May 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Can i Make custom Mob animation Slower?
Wed, 01/01/2020 - 00:57

So, im making exosuit for Player, like a robot that he's piloting but the problem is that Legs are really mad, they swing really fast and i would want to know if i can somehow make this animation slower, or atleast make my own animation.

 

Last seen on 13:36, 6. May 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Actually nevermind, I…
Wed, 01/01/2020 - 01:18

Actually nevermind, I searched the code and fixed it

Last seen on 16:01, 1. Jul 2021
Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Lol show me the code I wanna…
Sat, 01/04/2020 - 18:16

Lol show me the code I wanna see.

Last seen on 16:01, 1. Jul 2021
Joined Dec 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I always wanted mob…
Sat, 01/04/2020 - 18:16

I always wanted mob animations.

Last seen on 20:40, 10. Jul 2020
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
how did you slow it down i…
Tue, 04/21/2020 - 21:36

how did you slow it down i need to do that

 

Last seen on 20:40, 10. Jul 2020
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I need to know how to slow…
Tue, 04/21/2020 - 21:37

I need to know how to slow down the animation how did you do it? like where in the code?

 

Last seen on 01:27, 5. Sep 2020
Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I figured it out too a while…
Tue, 04/21/2020 - 22:23

I figured it out too a while back, but I'll help out too because I already see enough topics that end the same way.

In the code for the custom entities you'll wanna scroll to the very bottom. Down there, you will see all the different animations that look like this for example;

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity e) {
            super.setRotationAngles(f, f1, f2, f3, f4, f5, e);
            this.head.rotateAngleY = f3 / (180F / (float) Math.PI);
            this.head.rotateAngleX = f4 / (180F / (float) Math.PI);
            this.rightleg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
            this.leftleg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        }

Changing the speed is simple: edit the FIRST value of the swing animation. as an example, let's just use the leg rotations since that is what we are trying to fix.

in that section of the code, edit the number value to a lower or higher value respectively for the speed of the animation.

                                                                  Edit this here

                                                                           V

this.rightleg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;

 

Afterwards, it should look something like this:

 

this.rightleg.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1;

 

save the code, run the test environment, and you should see some results!

 

As a bonus:

 

this.rightleg.rotateAngleX = MathHelper.cos(f * 0.5F) * 1.0F * f1;

                                                                                          ^

                                                          That there changes the amount of rotation!

 

And there you have it! Hope this helps!

 

Last seen on 01:27, 5. Sep 2020
Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sorry if the arrows are a…
Tue, 04/21/2020 - 22:25

Sorry if the arrows are a little too far to the left, but they should be pointing to the (f * 1.0F) parts of the code.

Last seen on 13:36, 6. May 2021
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Also good thing would be to…
Wed, 04/22/2020 - 09:21

Also good thing would be to save the code of animation because everytime while you would want to unlock the code you will need to type it again what is, pretty hard with big models. You can copy it by selecting it and doing ctrl+c

Last seen on 01:27, 5. Sep 2020
Joined Apr 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
That would be true. There…
Wed, 04/22/2020 - 21:00

That would be true. There has been instances where I had custom code for the animations of mobs pre MCreator 1.9.1, and it would just get deleted by the code regeneration process. I had mobs with over 20 different moving parts that would get undone. It was some of the largest hassles I had to deal with, not gonna lie. :P

Last seen on 19:04, 29. Oct 2022
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thank you
Mon, 01/11/2021 - 01:40

thank you

Last seen on 22:45, 22. Jul 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
what file am i supposed to…
Tue, 07/19/2022 - 02:31

what file am i supposed to edit to do this?

Last seen on 21:21, 26. Oct 2022
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I can't even locate this…
Tue, 07/19/2022 - 05:22

I can't even locate this part lmao
 

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity e) {
            super.setRotationAngles(f, f1, f2, f3, f4, f5, e);
            this.head.rotateAngleY = f3 / (180F / (float) Math.PI);
            this.head.rotateAngleX = f4 / (180F / (float) Math.PI);
            this.rightleg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
            this.leftleg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        }

Last seen on 19:36, 6. Dec 2022
Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I can't find this code…
Fri, 12/02/2022 - 22:38

I can't find this code element in any way, there is only one object in fashion and there is no animation item in all the proposed codes