Package simplexity.villagerinfo.events
Class SoundEffectEvent
java.lang.Object
org.bukkit.event.Event
simplexity.villagerinfo.events.SoundEffectEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class SoundEffectEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when a sound effect is going to be sent to the player
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks player's PersistentDataContainer to see their current sound toggle statestatic org.bukkit.event.HandlerList
Gets the handler list for this evene@NotNull org.bukkit.event.HandlerList
Gets the handler list for this eveneorg.bukkit.entity.Player
Gets the player the sound will be played toorg.bukkit.Location
Gets the location of the Player this sound will be sent toorg.bukkit.Sound
getSound()
Gets the sound that has been configuredfloat
Gets the pitch that has been configuredfloat
Gets the volume that has been configuredboolean
Gets whether the event has been cancelledboolean
Gets if the player's sound toggle is enabledvoid
Plays the sound effect for the player
Uses getPlayerLocation(), getSound(), getSoundVolume(), and getSoundPitch()void
setCancelled
(boolean cancel) Sets whether this event should be cancelledvoid
setOverridePlayerSoundToggleEnabled
(boolean playerSoundToggleEnabled) Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settingsMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
SoundEffectEvent
public SoundEffectEvent(org.bukkit.entity.Player player)
-
-
Method Details
-
isCancelled
public boolean isCancelled()Gets whether the event has been cancelled- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
- boolean
-
setCancelled
public void setCancelled(boolean cancel) Sets whether this event should be cancelled- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the handler list for this evene- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- HandlerList
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the handler list for this evene- Returns:
- HandlerList
-
checkPlayerPDC
public void checkPlayerPDC()Checks player's PersistentDataContainer to see their current sound toggle state -
getSound
public org.bukkit.Sound getSound()Gets the sound that has been configured- Returns:
- org.bukkit.Sound
-
getSoundVolume
public float getSoundVolume()Gets the volume that has been configured- Returns:
- float
-
getSoundPitch
public float getSoundPitch()Gets the pitch that has been configured- Returns:
- float
-
getPlayerLocation
public org.bukkit.Location getPlayerLocation()Gets the location of the Player this sound will be sent to- Returns:
- Location
-
playSoundEffect
public void playSoundEffect()Plays the sound effect for the player
Uses getPlayerLocation(), getSound(), getSoundVolume(), and getSoundPitch() -
setOverridePlayerSoundToggleEnabled
public void setOverridePlayerSoundToggleEnabled(boolean playerSoundToggleEnabled) Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settings- Parameters:
playerSoundToggleEnabled
- boolean
-
isPlayerSoundToggleEnabled
public boolean isPlayerSoundToggleEnabled()Gets if the player's sound toggle is enabled- Returns:
- boolean
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player the sound will be played to- Returns:
- Player
-