Skip to content

Explosion ​

class · pocketmine\world\Explosion · source

Constants ​

DEFAULT_FIRE_CHANCE ​

php
public const DEFAULT_FIRE_CHANCE = 1.0 / 3.0

Properties ​

$affectedBlocks ​

php
public array $affectedBlocks

$radius ​

php
public float $radius

$source ​

php
public \pocketmine\world\Position $source

$stepLen ​

php
public float $stepLen

$world ​

php
public \pocketmine\world\World $world

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\Position $source, float $radius, \pocketmine\entity\Entity|\pocketmine\block\Block|null $what = null, float $fireChance = 0.0, array $excludedBlockTypeIds = [])

explodeA() ​

php
public function explodeA() : bool

Calculates which blocks will be destroyed by this explosion. If explodeB() is called without calling this, no blocks will be destroyed.

explodeB() ​

php
public function explodeB() : bool

Executes the explosion's effects on the world. This includes destroying blocks (if any), harming and knocking back entities, and creating sounds and particles.

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.

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