Skip to content

MoveToLiquidGoal 5.47.0 ​

class · pocketmine\entity\ai\goal\MoveToLiquidGoal · source

Extends MoveToBlockGoal

Goes back to water (vanilla behavior.move_to_water: axolotls, turtles, stranded dolphins, pregnant frogs) or lava (behavior.move_to_liquid with material_type Lava: striders) when out of it. Lava is looked for at its surface (the mob walks onto it), and the mob counts as being in it when $isInLiquid says so (default: its feet in water, its box in lava).

Constants ​

LAVA ​

php
public const LAVA = \pocketmine\entity\ai\navigation\BlockSearch::LAVA

WATER ​

php
public const WATER = \pocketmine\entity\ai\navigation\BlockSearch::WATER

Properties ​

$isInLiquid ​

php
public ?\Closure $isInLiquid

$liquid ​

php
public int $liquid

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, int $liquid = self::WATER, float $speedMultiplier = 1.0, int $searchRange = 16, int $searchHeight = 5, float $goalRadius = 0.5, ?\Closure $condition = null, ?\Closure $isInLiquid = null)

findTarget() protected ​

php
protected function findTarget(int $x, int $y, int $z) : ?\pocketmine\math\Vector3

wantsToMove() protected ​

php
protected function wantsToMove() : bool

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.