PocketMine-MP 5.23.3 git-fbaa125d0ce21ffef98fc1630881a92bedfbaa73
Loading...
Searching...
No Matches
pocketmine\event\world\WorldSoundEvent Class Reference
+ Inheritance diagram for pocketmine\event\world\WorldSoundEvent:
+ Collaboration diagram for pocketmine\event\world\WorldSoundEvent:

Public Member Functions

 __construct (World $world, private Sound $sound, private Vector3 $position, private array $recipients)
 
 call ()
 
 getEventName ()
 
 getPosition ()
 
 getRecipients ()
 
 getSound ()
 
 getWorld ()
 
 isCancelled ()
 
 setRecipients (array $recipients)
 
 setSound (Sound $sound)
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

string $eventName = null
 

Detailed Description

Called when a sound is played in a world

See also
World::addSound()

Definition at line 37 of file WorldSoundEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\world\WorldSoundEvent::__construct ( World $world,
private Sound $sound,
private Vector3 $position,
private array $recipients )
Parameters
Player[]$recipients

Definition at line 43 of file WorldSoundEvent.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.

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getPosition()

pocketmine\event\world\WorldSoundEvent::getPosition ( )

Definition at line 60 of file WorldSoundEvent.php.

◆ getRecipients()

pocketmine\event\world\WorldSoundEvent::getRecipients ( )
Returns
Player[]

Definition at line 67 of file WorldSoundEvent.php.

◆ getSound()

pocketmine\event\world\WorldSoundEvent::getSound ( )

Definition at line 52 of file WorldSoundEvent.php.

◆ getWorld()

pocketmine\event\world\WorldEvent::getWorld ( )
inherited

Definition at line 35 of file WorldEvent.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.

◆ setRecipients()

pocketmine\event\world\WorldSoundEvent::setRecipients ( array $recipients)
Parameters
Player[]$recipients

Definition at line 74 of file WorldSoundEvent.php.

◆ setSound()

pocketmine\event\world\WorldSoundEvent::setSound ( Sound $sound)

Definition at line 56 of file WorldSoundEvent.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: