PocketMine-MP 5.17.1 git-df4ada81e5d74a14046f27cf44a37dcee69d657e
pocketmine\event\entity\EntityShootBowEvent Class Reference
+ Inheritance diagram for pocketmine\event\entity\EntityShootBowEvent:
+ Collaboration diagram for pocketmine\event\entity\EntityShootBowEvent:

Public Member Functions

 __construct (Living $shooter, private Item $bow, Projectile $projectile, private float $force)
 
 call ()
 
 getBow ()
 
 getEntity ()
 
 getEventName ()
 
 getForce ()
 
 getProjectile ()
 
 isCancelled ()
 
 setForce (float $force)
 
 setProjectile (Entity $projectile)
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

Entity $entity
 
string $eventName = null
 

Detailed Description

@phpstan-extends EntityEvent<Living>

Definition at line 37 of file EntityShootBowEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\entity\EntityShootBowEvent::__construct ( Living  $shooter,
private Item  $bow,
Projectile  $projectile,
private float  $force 
)

Definition at line 42 of file EntityShootBowEvent.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.

◆ getBow()

pocketmine\event\entity\EntityShootBowEvent::getBow ( )

Definition at line 59 of file EntityShootBowEvent.php.

◆ getEntity()

pocketmine\event\entity\EntityShootBowEvent::getEntity ( )
Returns
Living

Reimplemented from pocketmine\event\entity\EntityEvent.

Definition at line 55 of file EntityShootBowEvent.php.

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

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getForce()

pocketmine\event\entity\EntityShootBowEvent::getForce ( )

Definition at line 81 of file EntityShootBowEvent.php.

◆ getProjectile()

pocketmine\event\entity\EntityShootBowEvent::getProjectile ( )

Returns the entity considered as the projectile in this event.

NOTE: This might not return a Projectile if a plugin modified the target entity.

Definition at line 68 of file EntityShootBowEvent.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.

◆ setForce()

pocketmine\event\entity\EntityShootBowEvent::setForce ( float  $force)

Definition at line 85 of file EntityShootBowEvent.php.

◆ setProjectile()

pocketmine\event\entity\EntityShootBowEvent::setProjectile ( Entity  $projectile)

Definition at line 72 of file EntityShootBowEvent.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: