Interface PlaySoundEvent
- All Superinterfaces:
Cancellable
,Event
- All Known Subinterfaces:
PlaySoundEvent.AtEntity
,PlaySoundEvent.Broadcast
,PlaySoundEvent.FromJukebox
,PlaySoundEvent.FromJukebox.Start
,PlaySoundEvent.FromJukebox.Stop
,PlaySoundEvent.NoteBlock
An umbrella event that fires when in-game sounds, such as
records in jukeboxes or sounds when boss entities die.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Fired when a sound is played at a specificEntity
static interface
static interface
Fired when a record is inserted into a Jukeboxstatic interface
Fired when a noteblock is triggered -
Method Summary
Modifier and TypeMethodDescriptionlocation()
Gets the location of the sound being played.float
pitch()
Gets the pitch of the sound being playedGets theSound.Source
for the sound being played.Gets theSoundType
for the sound being played.float
volume()
Gets the volume of the sound being played.Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
Method Details
-
location
ServerLocation location()Gets the location of the sound being played.- Returns:
- the location of the sound being played
-
soundType
SoundType soundType()Gets theSoundType
for the sound being played.- Returns:
- The
SoundType
-
soundSource
Sound.Source soundSource()Gets theSound.Source
for the sound being played.- Returns:
- The
Sound.Source
-
volume
float volume()Gets the volume of the sound being played.- Returns:
- A float that represents the relative volume. This value may be positive value.
-
pitch
float pitch()Gets the pitch of the sound being played- Returns:
- A float that represents the pitch.
-