Skip to content

RandomSwimGoal 5.47.0 ​

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

Extends RandomStrollGoal

Swims to a random spot in the water (vanilla behavior.random_swim). With interval 0 (fish) the mob starts a new swim as soon as the previous one ends, so it never stops; when no spot is found (a small pond, out of the water) it waits RandomSwimGoal::RETRY_TICKS ticks before trying again instead of searching on every evaluation.

Constants ​

RETRY_TICKS ​

php
public const RETRY_TICKS = 10

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier = 1.0, int $interval = 0, int $horizontalRange = 16, int $verticalRange = 4)

canStart() ​

php
public function canStart() : bool

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