PocketMine-MP 5.28.3 git-d5a1007c80fcee27feb2251cf5dcf1ad5a59a85c
Loading...
Searching...
No Matches
pocketmine\world\Explosion Class Reference
+ Collaboration diagram for pocketmine\world\Explosion:

Public Member Functions

 __construct (public Position $source, public float $radius, private Entity|Block|null $what=null, private float $fireChance=0.0)
 
 explodeA ()
 
 explodeB ()
 
 setFireChance (float $fireChance)
 

Public Attributes

array $affectedBlocks = []
 
float $stepLen = 0.3
 
World $world
 
const DEFAULT_FIRE_CHANCE = 1.0 / 3.0
 

Detailed Description

Definition at line 54 of file Explosion.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\world\Explosion::__construct ( public Position $source,
public float $radius,
private Entity|Block|null $what = null,
private float $fireChance = 0.0 )

Definition at line 71 of file Explosion.php.

Member Function Documentation

◆ explodeA()

pocketmine\world\Explosion::explodeA ( )

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

Definition at line 95 of file Explosion.php.

◆ explodeB()

pocketmine\world\Explosion::explodeB ( )

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

Definition at line 169 of file Explosion.php.

◆ setFireChance()

pocketmine\world\Explosion::setFireChance ( float $fireChance)

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.

Parameters
float$fireChance0 ... 1

Definition at line 278 of file Explosion.php.

Member Data Documentation

◆ $affectedBlocks

array pocketmine\world\Explosion::$affectedBlocks = []

Definition at line 64 of file Explosion.php.

◆ $stepLen

float pocketmine\world\Explosion::$stepLen = 0.3

Definition at line 65 of file Explosion.php.

◆ $world

World pocketmine\world\Explosion::$world

Definition at line 58 of file Explosion.php.

◆ DEFAULT_FIRE_CHANCE

const pocketmine\world\Explosion::DEFAULT_FIRE_CHANCE = 1.0 / 3.0

Definition at line 55 of file Explosion.php.


The documentation for this class was generated from the following file: