Skip to content

FreeAvoidEntityGoal 5.47.0 ​

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

Extends Goal

Swims (or flies) away from a dangerous entity that comes closer than $distance (vanilla behavior.avoid_mob_type of a free moving mob: guardians keeping away from players within 8 blocks while they are guardian_passive). Picks a point of the mob's medium (water) 4 to 8 blocks away, roughly opposite the danger, and moves to it in a straight line.

Properties ​

$control ​

php
public \pocketmine\entity\ai\hostile\FreeMoveControl $control

$distance ​

php
public float $distance

$finder ​

php
public \Closure $finder

$mob ​

php
public \pocketmine\entity\Mob $mob

$speed ​

php
public float $speed

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \pocketmine\entity\ai\hostile\FreeMoveControl $control, \Closure $finder, float $distance, float $speed)

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. Not affiliated with the PMMP team or Mojang.