Goal 5.46.0
A behaviour of a mob (wander, panic, attack...). Goals are run by a GoalSelector: a goal starts when Goal::canStart() returns true and no running goal with a higher priority holds any of its control flags, and stops when Goal::canContinue() returns false or a more important goal needs one of its flags.
Constants
FLAG_JUMP
public const FLAG_JUMP = 4The goal makes the mob jump.
FLAG_LOOK
public const FLAG_LOOK = 2The goal turns the mob's head (look control).
FLAG_MOVE
public const FLAG_MOVE = 1The goal moves the mob (pathfinding, move control).
FLAG_TARGET
public const FLAG_TARGET = 8The goal selects the mob's attack target.
Methods
canContinue()
public function canContinue() : boolReturns whether the running goal should keep running. Called every AI tick.
canStart()
abstract public function canStart() : boolReturns whether the goal should start now. Called only every few ticks (see GoalSelector), so it may do moderately expensive checks.
getFlags()
public function getFlags() : intReturns a bitmask of the FLAG_* constants this goal needs exclusively while it runs.
isInterruptible()
public function isInterruptible() : boolReturns whether a goal with a higher priority may stop this goal to take its flags.
start()
public function start() : voidstop()
public function stop() : voidtick()
public function tick() : voidCalled every AI tick while the goal runs.
