Interface Goal<T extends Mob>

All Known Subinterfaces:
VanillaGoal<T>

@NullMarked public interface Goal<T extends Mob>
Represents an AI goal of an entity
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    A unique key that identifies this type of goal.
    Returns a list of all applicable flags for this goal.
    boolean
    Checks if this goal should be activated
    default boolean
    Checks if this goal should stay active, defaults to shouldActivate()
    default void
    Called when this goal gets activated
    default void
    Called when this goal gets stopped
    default void
    Called each tick the goal is activated
  • Method Details Link icon

    • shouldActivate Link icon

      boolean shouldActivate()
      Checks if this goal should be activated
      Returns:
      if this goal should be activated
    • shouldStayActive Link icon

      default boolean shouldStayActive()
      Checks if this goal should stay active, defaults to shouldActivate()
      Returns:
      if this goal should stay active
    • start Link icon

      default void start()
      Called when this goal gets activated
    • stop Link icon

      default void stop()
      Called when this goal gets stopped
    • tick Link icon

      default void tick()
      Called each tick the goal is activated
    • getKey Link icon

      GoalKey<T> getKey()
      A unique key that identifies this type of goal. Plugins should use their own namespace, not the minecraft namespace. Additionally, this key also specifies to what mobs this goal can be applied to
      Returns:
      the goal key
    • getTypes Link icon

      EnumSet<GoalType> getTypes()
      Returns a list of all applicable flags for this goal.

      This method is only called on construction.

      Returns:
      the subtypes.