SwimWithEntityGoal 5.47.0
Extends Goal
Swims along with a swimming player (Bedrock behavior.swim_with_entity, dolphins): every state_check_interval the mob without a companion picks the nearest player swimming within search_range with success_rate, and a mob swimming with one stops with chance_to_stop. It swims to the player at speed_multiplier, at catch_up_multiplier when farther than catch_up_threshold, stops within stop_distance and, within match_direction_threshold, looks where the player looks (swims alongside).
Properties
$catchUpMultiplier
php
public float $catchUpMultiplier$catchUpThreshold
php
public float $catchUpThreshold$chanceToStop
php
public float $chanceToStop$filter
php
public ?\Closure $filter$matchDirectionThreshold
php
public float $matchDirectionThreshold$mob
php
public \pocketmine\entity\Mob $mob$searchRange
php
public float $searchRange$speedMultiplier
php
public float $speedMultiplier$stateCheckInterval
php
public int $stateCheckInterval$stopDistance
php
public float $stopDistance$successRate
php
public float $successRateMethods
__construct()
php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier = 1.5, float $searchRange = 20.0, float $successRate = 0.1, float $chanceToStop = 0.0333, int $stateCheckInterval = 10, float $catchUpThreshold = 12.0, float $catchUpMultiplier = 2.5, float $matchDirectionThreshold = 2.0, float $stopDistance = 5.0, ?\Closure $filter = null)canContinue()
php
public function canContinue() : boolcanStart()
php
public function canStart() : boolgetFlags()
php
public function getFlags() : intgetPlayer()
php
public function getPlayer() : ?\pocketmine\player\PlayerReturns the player the mob swims with, if any.
start()
php
public function start() : voidstop()
php
public function stop() : voidtick()
php
public function tick() : void