Skip to content

EnderPearl ​

class · pocketmine\entity\projectile\EnderPearl · source

Extends Throwable

Bedrock values (entities/ender_pearl.json): teleports its owner where it lands (5 fall damage) and has a 5% chance to spawn an endermite there (on_hit spawn_chance; not in peaceful, where it would despawn at once).

Constants ​

ENDERMITE_CHANCE 5.46.0 ​

php
public const ENDERMITE_CHANCE = 0.05

Methods ​

getEndermiteChance() 5.46.0 ​

php
public static function getEndermiteChance() : float

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

onHit() protected ​

php
protected function onHit(\pocketmine\event\entity\ProjectileHitEvent $event) : void

setEndermiteChance() 5.46.0 ​

php
public static function setEndermiteChance(?float $chance) : void

Overrides the chance that a landing pearl spawns an endermite (tests and test plugins); null restores the vanilla 5%.

trySpawnEndermite() 5.46.0 ​

php
public function trySpawnEndermite(\pocketmine\math\Vector3 $pos) : ?\pocketmine\entity\monster\Endermite

Rolls the endermite chance and spawns one at the given position.

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