Skip to content

FindPlayerMountGoal 5.47.0 ​

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

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 $startDelay

Methods ​

__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() : bool

canRide() ​

php
public static function canRide(\pocketmine\entity\Mob $mob, \pocketmine\player\Player $player) : bool

Returns whether the mob may get on the player now.

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

restartDelay() ​

php
public function restartDelay() : void

Waits the start delay again before looking for a player (called when the mob got off one).

start() ​

php
public function start() : void

stop() ​

php
public function stop() : void

tick() ​

php
public function tick() : void

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