Jump to content

[1.19.2] How to determine that an entity is attacking?


Recommended Posts

Posted

I'm using geckoLib, I'd like to add an attack animation to an entity.
 

Spoiler
public class DrevoEntity extends IronGolem implements NeutralMob, IAnimatable {
...
  private <E extends IAnimatable> PlayState predicate (AnimationEvent<E> event){
          if (//Here//){
              event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.drevo.attack"));
              return PlayState.CONTINUE;
          }
          if(event.isMoving()){
              event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.drevo.walk"));
              return PlayState.CONTINUE;
          }
          return PlayState.CONTINUE;
    }
...

 

 

The IronGolem#doHurtTarget methods associated with the entity fire when it attacks, but I'm not sure if I can use it somehow?

Posted

I don't know why you keep asking geckolib questions here?

These are the forge support forums.

You should ask wherever geckolib provides support or I believe there is a third party modding channel on forge's discord.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.