Package com.destroystokyo.paper.entity.ai

# 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 Type
Method
Description
`@NotNull GoalKey<T>`
`getKey()`
A unique key that identifies this type of goal.
`@NotNull EnumSet<GoalType>`
`getTypes()`
Returns a list of all applicable flags for this goal.
This method is only called on construction.
`boolean`
`shouldActivate()`
Checks if this goal should be activated
`default boolean`
`shouldStayActive()`
Checks if this goal should stay active, defaults to `shouldActivate()`
`default void`
`start()`
Called when this goal gets activated
`default void`
`stop()`
Called when this goal gets stopped
`default 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 to `shouldActivate()`

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

@NotNull @NotNull 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

@NotNull @NotNull EnumSet<GoalType> getTypes()
Returns a list of all applicable flags for this goal.
This method is only called on construction.

Returns:
  the subtypes.