Skip to content

EntityPreExplodeEvent ​

class · pocketmine\event\entity\EntityPreExplodeEvent · source

Extends EntityEvent
Implements Cancellable

Called when an entity decides to explode, before the explosion's impact is calculated. This allows changing the force of the explosion and whether it will destroy blocks.

Properties ​

$radius ​

php
public float $radius

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Entity $entity, float $radius, float $fireChance = 0.0)

getFireChance() ​

php
public function getFireChance() : float

Returns a chance between 0 and 1 of creating a fire.

getRadius() ​

php
public function getRadius() : float

isBlockBreaking() ​

php
public function isBlockBreaking() : bool

isIncendiary() ​

php
public function isIncendiary() : bool

Returns whether the explosion will create a fire.

setBlockBreaking() ​

php
public function setBlockBreaking(bool $affectsBlocks) : void

setFireChance() ​

php
public function setFireChance(float $fireChance) : void

Sets a chance between 0 and 1 of creating a fire. For example, if the chance is 1/3, then that amount of affected blocks will be ignited.

setIncendiary() ​

php
public function setIncendiary(bool $incendiary) : void

Sets whether the explosion will create a fire by filling fireChance with default values.

If $incendiary is true, the fire chance will be filled only if explosion isn't currently creating a fire (if fire chance is 0).

setRadius() ​

php
public function setRadius(float $radius) : void

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