EntityPreExplodeEvent
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 $radiusMethods
__construct()
php
public function __construct(\pocketmine\entity\Entity $entity, float $radius, float $fireChance = 0.0)getFireChance()
php
public function getFireChance() : floatReturns a chance between 0 and 1 of creating a fire.
getRadius()
php
public function getRadius() : floatisBlockBreaking()
php
public function isBlockBreaking() : boolisIncendiary()
php
public function isIncendiary() : boolReturns whether the explosion will create a fire.
setBlockBreaking()
php
public function setBlockBreaking(bool $affectsBlocks) : voidsetFireChance()
php
public function setFireChance(float $fireChance) : voidSets 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) : voidSets 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