FreeWanderGoal 5.46.0
Extends Goal
Moves a flying or swimming mob to random points nearby from time to time (vanilla behavior.float_wander, random_swim, vex random move). Points are picked in the medium the mob moves in: open air for flyers, water for swimmers.
Constants
MEDIUM_AIR
php
public const MEDIUM_AIR = 0MEDIUM_ANY
php
public const MEDIUM_ANY = 2Anything that doesn't block movement (noclip vexes pick points inside blocks too).
MEDIUM_WATER
php
public const MEDIUM_WATER = 1Properties
$anchor
php
public ?\Closure $anchor$control
php
public \pocketmine\entity\ai\hostile\FreeMoveControl $control$horizontalRange
php
public int $horizontalRange$interval
php
public int $interval$medium
php
public int $medium$mob
php
public \pocketmine\entity\Mob $mob$speed
php
public float $speed$verticalRange
php
public int $verticalRangeMethods
__construct()
php
public function __construct(\pocketmine\entity\Mob $mob, \pocketmine\entity\ai\hostile\FreeMoveControl $control, float $speed, int $interval = 60, int $horizontalRange = 8, int $verticalRange = 4, int $medium = self::MEDIUM_AIR, ?\Closure $anchor = null)canContinue()
php
public function canContinue() : boolcanStart()
php
public function canStart() : boolgetFlags()
php
public function getFlags() : intisLineClear() protected
php
protected function isLineClear(float $x, float $y, float $z) : boolReturns whether the straight line from the mob to the point only crosses blocks of the mob's medium (sampled every block).
pickPoint() protected
php
protected function pickPoint() : ?\pocketmine\math\Vector3start()
php
public function start() : voidstop()
php
public function stop() : void