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

    Constructors
    Constructor
    Description
    SoundEffectEvent(org.bukkit.entity.Player player)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks player's PersistentDataContainer to see their current sound toggle state
    static org.bukkit.event.HandlerList
    Gets the handler list for this evene
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this evene
    org.bukkit.entity.Player
    Gets the player the sound will be played to
    org.bukkit.Location
    Gets the location of the Player this sound will be sent to
    org.bukkit.Sound
    Gets the sound that has been configured
    float
    Gets the pitch that has been configured
    float
    Gets the volume that has been configured
    boolean
    Gets whether the event has been cancelled
    boolean
    Gets if the player's sound toggle is enabled
    void
    Plays the sound effect for the player
    Uses getPlayerLocation(), getSound(), getSoundVolume(), and getSoundPitch()
    void
    setCancelled(boolean cancel)
    Sets whether this event should be cancelled
    void
    setOverridePlayerSoundToggleEnabled(boolean playerSoundToggleEnabled)
    Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settings

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface org.bukkit.event.Cancellable
      Returns:
      boolean
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets whether this event should be cancelled
      Specified by:
      setCancelled in interface org.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 class org.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