Class FleeGoal<T extends org.bukkit.entity.Mob>

java.lang.Object
io.github.addoncommunity.galactifun.api.aliens.behaviors.AlienBehavior<T>
io.github.addoncommunity.galactifun.api.aliens.behaviors.FleeGoal<T>
All Implemented Interfaces:
com.destroystokyo.paper.entity.ai.Goal<T>, org.bukkit.event.Listener

public final class FleeGoal<T extends org.bukkit.entity.Mob> extends AlienBehavior<T> implements org.bukkit.event.Listener
Flees if attacked in the last fleeTicks ticks
  • Constructor Details

    • FleeGoal

      public FleeGoal(@Nonnull Class<T> entityClass, @Nonnull T mob, int fleeTicks)
  • Method Details

    • onHit

      public void onHit(org.bukkit.event.entity.EntityDamageEvent e)
    • shouldActivate

      public boolean shouldActivate()
      Specified by:
      shouldActivate in interface com.destroystokyo.paper.entity.ai.Goal<T extends org.bukkit.entity.Mob>
    • shouldStayActive

      public boolean shouldStayActive()
      Specified by:
      shouldStayActive in interface com.destroystokyo.paper.entity.ai.Goal<T extends org.bukkit.entity.Mob>
    • stop

      public void stop()
      Specified by:
      stop in interface com.destroystokyo.paper.entity.ai.Goal<T extends org.bukkit.entity.Mob>
    • tick

      public void tick()
      Specified by:
      tick in interface com.destroystokyo.paper.entity.ai.Goal<T extends org.bukkit.entity.Mob>
    • getTypes

      @Nonnull public EnumSet<com.destroystokyo.paper.entity.ai.GoalType> getTypes()
      Specified by:
      getTypes in interface com.destroystokyo.paper.entity.ai.Goal<T extends org.bukkit.entity.Mob>
      Specified by:
      getTypes in class AlienBehavior<T extends org.bukkit.entity.Mob>