Skip to content

FleeEntityGoal 5.46.0 ​

class · pocketmine\entity\ai\hostile\goal\FleeEntityGoal · source

Extends Goal

Walks away from a dangerous entity when it comes closer than $distance (vanilla behavior.avoid_mob_type: evokers keeping their distance from players, piglins fleeing zombified piglins).

Properties ​

$distance ​

php
public float $distance

$finder ​

php
public \Closure $finder

$mob ​

php
public \pocketmine\entity\Mob $mob

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \Closure $finder, float $distance, float $speedMultiplier)

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

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.