PocketMine-MP 5.28.3 git-d5a1007c80fcee27feb2251cf5dcf1ad5a59a85c
|
Public Member Functions | |
__construct (Block $block, private float $radius, private readonly ?Player $player=null, private float $fireChance=0.0) | |
call () | |
getBlock () | |
getEventName () | |
getFireChance () | |
getPlayer () | |
getRadius () | |
isBlockBreaking () | |
isCancelled () | |
isIncendiary () | |
setBlockBreaking (bool $affectsBlocks) | |
setFireChance (float $fireChance) | |
setIncendiary (bool $incendiary) | |
setRadius (float $radius) | |
Static Public Member Functions | |
static | hasHandlers () |
Protected Attributes | |
string | $eventName = null |
Called when a block wants to explode, before the explosion impact is calculated. This allows changing the explosion force, fire chance and whether it will destroy blocks.
Definition at line 39 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::__construct | ( | Block | $block, |
private float | $radius, | ||
private readonly ?Player | $player = null, | ||
private float | $fireChance = 0.0 ) |
Definition at line 44 of file BlockPreExplodeEvent.php.
|
inherited |
|
inherited |
Definition at line 37 of file BlockEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::getFireChance | ( | ) |
Returns a chance between 0 and 1 of creating a fire.
Definition at line 104 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::getPlayer | ( | ) |
Returns the player who triggered the block explosion. Returns null if the block was exploded by other means.
Definition at line 126 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::getRadius | ( | ) |
Definition at line 61 of file BlockPreExplodeEvent.php.
|
staticinherited |
pocketmine\event\block\BlockPreExplodeEvent::isBlockBreaking | ( | ) |
Definition at line 73 of file BlockPreExplodeEvent.php.
|
inherited |
Returns whether this instance of the event is currently cancelled.
If it is cancelled, only downstream handlers that declare @handleCancelled
will be called with this event.
pocketmine\event\block\BlockPreExplodeEvent::isIncendiary | ( | ) |
Returns whether the explosion will create a fire.
Definition at line 84 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::setBlockBreaking | ( | bool | $affectsBlocks | ) |
Definition at line 77 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::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.
float | $fireChance | 0 ... 1 |
Definition at line 114 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::setIncendiary | ( | bool | $incendiary | ) |
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).
Definition at line 93 of file BlockPreExplodeEvent.php.
pocketmine\event\block\BlockPreExplodeEvent::setRadius | ( | float | $radius | ) |
Definition at line 65 of file BlockPreExplodeEvent.php.
|
protectedinherited |