[Geckolib] How do I make custom animations play depending on mob's health?

Started by b.ART.ek on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Geckolib] How do I make custom animations play depending on mob's health?

I'm trying to make a mob that has different animations depending on how much health it has. However I'm doing something wrong and animations don't want to work and loop properly. I thought I understand the tutorial nut i guess i was wrong. 


Here is my Play Returned Animation procedure:

and Loop External Animations Procedure:

 

Can someone please help me and maybe show some screenshots of how the procedures should look like?

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
As you want looping…
Sun, 04/09/2023 - 01:51

As you want looping animations, Play Returned Animation is not necessary.

In Loop External Animations, you need to put an animation block before every "Return true" block, called "If entity element __ is the Event/target entity then play the animation __", which you can find in the "GeckoLib" section. 

In the "No entry selected" field goes your mob, in the text field goes the name of the corresponding animation.

I wanted to share an screenshot of how it would look like, but apparently I can't upload files, so I hope you understood it this way :)

 

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
did that, but animation…
Sun, 04/09/2023 - 06:06

did that, but animation plays for all entites of that type, even for entities of that type that doesn't meet play animation condition.

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for explanation. Btw…
Sun, 04/09/2023 - 12:19

Thanks for explanation. Btw you can send screenshots by adding link to a photo. I upload screenshots on discord then open the image and link it