Skip to content

FindCoverGoal 5.47.0 ​

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

Extends Goal

Walks from under the open sky into the shade (vanilla behavior.find_cover of foxes: by day, and at once during thunderstorms; Java FoxSeekShelterGoal): picks one of 10 random spots up to 10 blocks away horizontally and 3 vertically with no sky above it, and walks there.

The goal tries at most once every $cooldown ticks (and at most once a second), and only while $condition allows it and the mob sees the sky: a sky light lookup when it is already in the shade.

Properties ​

$condition ​

php
public \Closure $condition

$cooldown ​

php
public int $cooldown

$mob ​

php
public \pocketmine\entity\Mob $mob

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \Closure $condition, float $speedMultiplier = 1.0, int $cooldown = 100)

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.