Skip to content

FleeSunGoal 5.47.0 ​

final class · pocketmine\entity\ai\goal\FleeSunGoal · source

Extends Goal

A mob burning in the sun runs for the shade (vanilla behavior.flee_sun of skeletons, strays, bogged, parched and drowned; Java FleeSunGoal): by day, when it is on fire under the open sky with nothing on its head, it picks one of 10 random spots up to 10 blocks away horizontally and 3 vertically that is out of the sun, and walks there.

Only burning mobs look for a spot (a few flag checks otherwise), and a mob which found none waits a second before looking again.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier = 1.0)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

isDay() ​

php
public static function isDay(\pocketmine\world\World $world) : bool

Whether it is day in the world for the undead (vanilla isBrightOutside(): the overworld, sky light reduced by less than 4).

seesSky() ​

php
public static function seesSky(\pocketmine\world\World $world, int $x, int $y, int $z) : bool

Whether the block is under the open sky (full sky light, the light the sun burns the undead in).

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.