Skip to content

Creeper 5.46.0 ​

class · pocketmine\entity\monster\Creeper · source

Extends Monster
Implements Explosive

Bedrock values: 20 health, movement 0.2 (approaches its target at 1.25x), fuse 1.5 seconds started within 2.5 blocks of its target and cancelled beyond 6 blocks, explosion power 3 (6 when charged: struck by lightning, POWERED flag). Can be ignited with flint and steel. Runs away from cats and ocelots within 6 blocks (behavior.avoid_mob_type, sprinting at 1.2x). Loot: 0-2 gunpowder (+0-1 per Looting level), and a music disc when killed by a skeleton's arrow.

Constants ​

DEFAULT_FUSE ​

php
public const DEFAULT_FUSE = 30

EXPLOSION_POWER ​

php
public const EXPLOSION_POWER = 3.0

TAG_FUSE ​

php
public const TAG_FUSE = "Fuse"

TAG_IGNITED ​

php
public const TAG_IGNITED = "ignited"

TAG_POWERED ​

php
public const TAG_POWERED = "powered"

Methods ​

attack() ​

php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : void

entityBaseTick() protected ​

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

explode() ​

php
public function explode() : void

getDrops() ​

php
public function getDrops() : array

getFuse() ​

php
public function getFuse() : int

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getSwell() ​

php
public function getSwell() : int

getSwellDirection() ​

php
public function getSwellDirection() : int

hasExploded() ​

php
public function hasExploded() : bool

ignite() ​

php
public function ignite() : void

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isIgnited() ​

php
public function isIgnited() : bool

Whether the creeper was ignited by flint and steel: it explodes whatever happens.

isPowered() ​

php
public function isPowered() : bool

isSwelling() ​

php
public function isSwelling() : bool

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

onStruckByLightning() ​

php
public function onStruckByLightning(\pocketmine\entity\object\LightningBolt $bolt) : void

Lightning makes a charged creeper (vanilla: it also takes the damage and the fire).

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setPowered() ​

php
public function setPowered(bool $powered) : void

setSwellDirection() ​

php
public function setSwellDirection(int $direction) : void

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

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