PocketMine-MP 5.28.3 git-d5a1007c80fcee27feb2251cf5dcf1ad5a59a85c
Loading...
Searching...
No Matches
pocketmine\event\block\BlockExplodeEvent Class Reference
+ Inheritance diagram for pocketmine\event\block\BlockExplodeEvent:
+ Collaboration diagram for pocketmine\event\block\BlockExplodeEvent:

Public Member Functions

 __construct (Block $block, private Position $position, private array $blocks, private float $yield, private array $ignitions)
 
 call ()
 
 getAffectedBlocks ()
 
 getBlock ()
 
 getEventName ()
 
 getIgnitions ()
 
 getPosition ()
 
 getYield ()
 
 isCancelled ()
 
 setAffectedBlocks (array $blocks)
 
 setIgnitions (array $ignitions)
 
 setYield (float $yield)
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

string $eventName = null
 

Detailed Description

Called when a block explodes, after explosion impact has been calculated.

See also
BlockPreExplodeEvent

Definition at line 37 of file BlockExplodeEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\block\BlockExplodeEvent::__construct ( Block $block,
private Position $position,
private array $blocks,
private float $yield,
private array $ignitions )
Parameters
Block[]$blocks
Block[]$ignitions

Definition at line 44 of file BlockExplodeEvent.php.

Member Function Documentation

◆ call()

pocketmine\event\Event::call ( )
inherited

Calls event handlers registered for this event.

Exceptions

RuntimeException if event call recursion reaches the max depth limit

Definition at line 49 of file Event.php.

◆ getAffectedBlocks()

pocketmine\event\block\BlockExplodeEvent::getAffectedBlocks ( )

Returns a list of blocks destroyed by the explosion.

Returns
Block[]

Definition at line 90 of file BlockExplodeEvent.php.

◆ getBlock()

pocketmine\event\block\BlockEvent::getBlock ( )
inherited

Definition at line 37 of file BlockEvent.php.

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getIgnitions()

pocketmine\event\block\BlockExplodeEvent::getIgnitions ( )

Returns a list of affected blocks that will be replaced by fire.

Returns
Block[]

Definition at line 109 of file BlockExplodeEvent.php.

◆ getPosition()

pocketmine\event\block\BlockExplodeEvent::getPosition ( )

Definition at line 59 of file BlockExplodeEvent.php.

◆ getYield()

pocketmine\event\block\BlockExplodeEvent::getYield ( )

Returns the percentage chance of drops from each block destroyed by the explosion.

Returns
float 0-100

Definition at line 68 of file BlockExplodeEvent.php.

◆ hasHandlers()

static pocketmine\event\Event::hasHandlers ( )
staticinherited

Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.

Usage: SomeEventClass::hasHandlers()

Definition at line 77 of file Event.php.

◆ isCancelled()

pocketmine\event\Cancellable::isCancelled ( )
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.

◆ setAffectedBlocks()

pocketmine\event\block\BlockExplodeEvent::setAffectedBlocks ( array $blocks)

Sets the blocks destroyed by the explosion.

Parameters
Block[]$blocks

Definition at line 99 of file BlockExplodeEvent.php.

◆ setIgnitions()

pocketmine\event\block\BlockExplodeEvent::setIgnitions ( array $ignitions)

Set the list of blocks that will be replaced by fire.

Parameters
Block[]$ignitions

Definition at line 118 of file BlockExplodeEvent.php.

◆ setYield()

pocketmine\event\block\BlockExplodeEvent::setYield ( float $yield)

Sets the percentage chance of drops from each block destroyed by the explosion.

Parameters
float$yield0-100

Definition at line 77 of file BlockExplodeEvent.php.

Member Data Documentation

◆ $eventName

string pocketmine\event\Event::$eventName = null
protectedinherited

Definition at line 38 of file Event.php.


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