Skip to content

FleeBlockGoal 5.46.0 ​

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

Extends Goal

Walks away from a block the mob is afraid of (vanilla behavior.avoid_block: hoglins avoiding warped fungus, portals and respawn anchors, piglins avoiding soul fire). The finder looks for the block and should cache its result, since it is asked every goal evaluation.

Properties ​

$finder ​

php
public \Closure $finder

$mob ​

php
public \pocketmine\entity\Mob $mob

$onFlee ​

php
public ?\Closure $onFlee

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \Closure $finder, float $speedMultiplier, ?\Closure $onFlee = null)

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.