FindPlayerMountGoal 5.47.0
Extends Goal
A mob flies or walks to the nearest player with a free seat for it and gets on (vanilla behavior.find_mount with the player as the mount: tamed parrots landing on a shoulder; within_radius 16, mount_distance 2, start_delay 100, avoid_water). Players flying, gliding, swimming, sleeping or standing in water are not mounted.
The start delay runs again every time the mob gets off (see FindPlayerMountGoal::restartDelay()), and the search waits a second after finding nobody.
Properties
$canMount
php
public ?\Closure $canMount$mob
php
public \pocketmine\entity\Mob $mob$mountDistance
php
public float $mountDistance$radius
php
public float $radius$startDelay
php
public int $startDelayMethods
__construct()
php
public function __construct(\pocketmine\entity\Mob $mob, float $radius = 16.0, float $mountDistance = 2.0, int $startDelay = 100, ?\Closure $canMount = null)canContinue()
php
public function canContinue() : boolcanRide()
php
public static function canRide(\pocketmine\entity\Mob $mob, \pocketmine\player\Player $player) : boolReturns whether the mob may get on the player now.
canStart()
php
public function canStart() : boolgetFlags()
php
public function getFlags() : intrestartDelay()
php
public function restartDelay() : voidWaits the start delay again before looking for a player (called when the mob got off one).
start()
php
public function start() : voidstop()
php
public function stop() : voidtick()
php
public function tick() : void