how to do geckolib animation on creature flight re: what event trigger should i use?

Started by nembirde on

Topic category: Help with modding (Java Edition)

Last seen on 16:45, 21. Jul 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to do geckolib animation on creature flight re: what event trigger should i use?

hello, i'm new to minecraft modding and making a custom living entity with geckolib animations. i'm modding for 1.18.2 since that's what my server's running. my only real "coding" background is like, using scratch in high school and messing around with scripting for stardew, so my knowledge is pretty sparse, but i can at least chunk java building blocks together... 

the custom entity loads, and the geckolib model seems to load fine and performs all my other animations, including one with a custom trigger. right now, i'm trying to get a flight animation to work whenever the entity is not on the ground. what event trigger should i be using for this? originally i used "entity jumps" but it wasn't playing the animation so i assume it wasn't checking it after the initial jump, if at all. next i tried using either entity tick update or entity joins the world with an if statement checking if the event entity was my entity, and the world would no longer load (loaded to 100% then did not finish load) so i assume checking that frequently was too much... is there a different event trigger that i should be calling or some other way to do this with a procedure? the only other idea i have is something like this (from the pinned tutorial):

 if (!event.isOnGround()) {

        event.getController().setAnimation(new AnimationBuilder().addAnimation("fly", true));

        return PlayState.CONTINUE;

     }

thank you in advance for your ideas.

Last seen on 16:45, 21. Jul 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yup, got the latter properly…
Mon, 02/27/2023 - 05:23

yup, got the latter properly formatted to work in the entity java file, and it does play the animation just fine, but i'd still like input if someone knows how to do this as a mcreator procedure instead? since i don't trust my own ability to play around with the entity's code i'd like to avoid doing that as much as possible

Last seen on 03:52, 19. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the latest version of the…
Mon, 02/27/2023 - 12:46

the latest version of the plugin that works in the snapshot has this as a built-in feature.

Last seen on 16:45, 21. Jul 2023
Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh, thank you - i've been…
Mon, 02/27/2023 - 19:20

oh, thank you - i've been using the last stable so i'll try that out, i'm sure it'll interact less with my other custom animations that way too