PocketMine-MP 5.15.1 git-5ef247620a7c6301a849b54e5ef1009217729fc8
pocketmine\event\entity\EntityExplodeEvent Class Reference
+ Inheritance diagram for pocketmine\event\entity\EntityExplodeEvent:
+ Collaboration diagram for pocketmine\event\entity\EntityExplodeEvent:

Public Member Functions

 __construct (Entity $entity, protected Position $position, protected array $blocks, protected float $yield)
 
 call ()
 
 getBlockList ()
 
 getEntity ()
 
 getEventName ()
 
 getPosition ()
 
 getYield ()
 
 isCancelled ()
 
 setBlockList (array $blocks)
 
 setYield (float $yield)
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

Entity $entity
 
string $eventName = null
 

Detailed Description

Called when an entity explodes, after the explosion's impact has been calculated. No changes have been made to the world at this stage.

See also
EntityPreExplodeEvent

@phpstan-extends EntityEvent<Entity>

Definition at line 41 of file EntityExplodeEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\entity\EntityExplodeEvent::__construct ( Entity  $entity,
protected Position  $position,
protected array  $blocks,
protected float  $yield 
)
Parameters
Block[]$blocks
float$yield0-100

Definition at line 48 of file EntityExplodeEvent.php.

References pocketmine\event\entity\EntityEvent\$entity.

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.

◆ getBlockList()

pocketmine\event\entity\EntityExplodeEvent::getBlockList ( )

Returns a list of blocks destroyed by the explosion.

Returns
Block[]

Definition at line 69 of file EntityExplodeEvent.php.

◆ getEntity()

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getPosition()

pocketmine\event\entity\EntityExplodeEvent::getPosition ( )

Definition at line 60 of file EntityExplodeEvent.php.

◆ getYield()

pocketmine\event\entity\EntityExplodeEvent::getYield ( )

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

Returns
float 0-100

Definition at line 87 of file EntityExplodeEvent.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.

◆ setBlockList()

pocketmine\event\entity\EntityExplodeEvent::setBlockList ( array  $blocks)

Sets the blocks destroyed by the explosion.

Parameters
Block[]$blocks

Definition at line 78 of file EntityExplodeEvent.php.

◆ setYield()

pocketmine\event\entity\EntityExplodeEvent::setYield ( float  $yield)

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

Parameters
float$yield0-100

Definition at line 95 of file EntityExplodeEvent.php.

Member Data Documentation

◆ $entity

◆ $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: