Skip to content

FollowOwnerGoal 5.46.0 ​

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

Extends Goal

Follows the owner (or another leader given by the callback) when it gets farther than $startDistance, stopping at $stopDistance, and teleports next to it beyond $teleportDistance (vanilla behavior.follow_owner and teleport_to_owner; also used by allays following the player who gave them an item).

Properties ​

$flying ​

php
public bool $flying

$mob ​

php
public \pocketmine\entity\Mob $mob

$ownerGetter ​

php
public \Closure $ownerGetter

$speedMultiplier ​

php
public float $speedMultiplier

$startDistance ​

php
public float $startDistance

$stopDistance ​

php
public float $stopDistance

$teleportDistance ​

php
public float $teleportDistance

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \Closure $ownerGetter, float $speedMultiplier = 1.0, float $startDistance = 10.0, float $stopDistance = 2.0, float $teleportDistance = 12.0, bool $flying = false)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

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, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.