Skip to content

Monster 5.46.0 ​

abstract class · pocketmine\entity\monster\Monster · source

Extends Mob

A hostile mob. Removed in peaceful difficulty; when not persistent (naturally spawned and not named) it despawns far from players like other mobs (see \pocketmine\world\mobs\MobDespawner).

Constants ​

DESPAWN_INSTANT_DISTANCE ​

php
public const DESPAWN_INSTANT_DISTANCE = 128

DESPAWN_RANDOM_DISTANCE ​

php
public const DESPAWN_RANDOM_DISTANCE = 32

Methods ​

burnsInDaylight() ​

php
public function burnsInDaylight() : bool

Whether the mob catches fire in sunlight (zombies, skeletons).

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

getXpDropAmount() ​

php
public function getXpDropAmount() : int

isInDaylight() ​

php
public function isInDaylight() : bool

Returns whether the mob is exposed to the sun (daytime, sky directly above its head, not in water or rain).

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