Interface Goal<T extends Mob>
- All Known Subinterfaces:
VanillaGoal<T>
public interface Goal<T extends Mob>
Represents an AI goal of an entity
-
Method Summary
Modifier and TypeMethodDescriptiongetKey()
A unique key that identifies this type of goal.getTypes()
Returns a list of all applicable flags for this goal.
This method is only called on construction.boolean
Checks if this goal should be activateddefault boolean
Checks if this goal should stay active, defaults toshouldActivate()
default void
start()
Called when this goal gets activateddefault void
stop()
Called when this goal gets stoppeddefault void
tick()
Called each tick the goal is activated
-
Method Details
-
shouldActivate
boolean shouldActivate()Checks if this goal should be activated- Returns:
- if this goal should be activated
-
shouldStayActive
default boolean shouldStayActive()Checks if this goal should stay active, defaults toshouldActivate()
- Returns:
- if this goal should stay active
-
start
default void start()Called when this goal gets activated -
stop
default void stop()Called when this goal gets stopped -
tick
default void tick()Called each tick the goal is activated -
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
Returns a list of all applicable flags for this goal.
This method is only called on construction.- Returns:
- the subtypes.
-