Creeper 5.46.0
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 = 30EXPLOSION_POWER
php
public const EXPLOSION_POWER = 3.0TAG_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) : voidentityBaseTick() protected
php
protected function entityBaseTick(int $tickDiff = 1) : boolexplode()
php
public function explode() : voidgetDrops()
php
public function getDrops() : arraygetFuse()
php
public function getFuse() : intgetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
php
public function getName() : stringgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringgetSwell()
php
public function getSwell() : intgetSwellDirection()
php
public function getSwellDirection() : inthasExploded()
php
public function hasExploded() : boolignite()
php
public function ignite() : voidinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisIgnited()
php
public function isIgnited() : boolWhether the creeper was ignited by flint and steel: it explodes whatever happens.
isPowered()
php
public function isPowered() : boolisSwelling()
php
public function isSwelling() : boolonInteractWithItem() protected
php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolonStruckByLightning()
php
public function onStruckByLightning(\pocketmine\entity\object\LightningBolt $bolt) : voidLightning makes a charged creeper (vanilla: it also takes the damage and the fire).
registerGoals() protected
php
protected function registerGoals() : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetPowered()
php
public function setPowered(bool $powered) : voidsetSwellDirection()
php
public function setSwellDirection(int $direction) : voidsyncNetworkData() protected
php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void