StraightLineNavigator 5.46.0
class · pocketmine\entity\ai\navigation\StraightLineNavigator · source
Extends PathNavigator
Navigation of flying and swimming mobs: they move in a straight line to the target (vanilla fish, bats, bees and allays mostly do too) with a \pocketmine\entity\ai\control\FlyingMoveControl or \pocketmine\entity\ai\control\SwimmingMoveControl. No path search is done, so it costs nothing; a mob that makes no progress for a while (blocked by a wall) gives up, and the goals pick another target.
Methods
__construct()
php
public function __construct(\pocketmine\entity\Mob $owner)getPath()
php
public function getPath() : ?\pocketmine\entity\ai\navigation\PathisDone()
php
public function isDone() : boolmoveTo()
php
public function moveTo(float $x, float $y, float $z, float $speedMultiplier, float $acceptDistance = 0.0) : boolMoves to the given point (not the block: flying and swimming targets are positions, usually block centres).
moveToEntity()
php
public function moveToEntity(\pocketmine\entity\Entity $entity, float $speedMultiplier, float $acceptDistance = 1.0) : boolsetSpeedMultiplier()
php
public function setSpeedMultiplier(float $speedMultiplier) : voidstop()
php
public function stop() : voidtick()
php
public function tick() : void