Interface Goal
public interface Goal
One behaviour a mob may pursue, scheduled by its
Goals.
A single goal runs at a time. Each tick, a goal of better priority than the running one that can start preempts it; the running goal stops once it no longer should continue.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanStart()Returnstrueif the goal may start now.intpriority()Returns the priority of this goal; the lower the value, the more important the goal.booleanReturnstrueif the goal, once running, should keep running.default voidstart()Called when the goal starts running.default voidstop()Called when the goal stops running, because it ended or was preempted.default voidtick()Called every tick while the goal runs.
-
Method Details
-
priority
int priority()Returns the priority of this goal; the lower the value, the more important the goal.- Returns:
- the priority of this goal; the lower the value, the more important the goal
- Since:
- 0.1.0
-
canStart
boolean canStart()Returnstrueif the goal may start now.- Returns:
trueif the goal may start now- Since:
- 0.1.0
-
shouldContinue
boolean shouldContinue()Returnstrueif the goal, once running, should keep running.- Returns:
trueif the goal, once running, should keep running- Since:
- 0.1.0
-
start
default void start()Called when the goal starts running.- Since:
- 0.1.0
-
stop
default void stop()Called when the goal stops running, because it ended or was preempted.- Since:
- 0.1.0
-
tick
default void tick()Called every tick while the goal runs.- Since:
- 0.1.0
-