Class SoundAction

java.lang.Object
io.github.lucfr1746.llibrary.action.Action
io.github.lucfr1746.llibrary.action.list.SoundAction

public class SoundAction extends Action
Represents an action that plays a sound for a player.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SoundAction(org.bukkit.Sound sound, float volume, float pitch)
    Constructs a SoundAction with the specified sound, volume, and pitch.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(org.bukkit.entity.Player target)
    Executes the action, playing the sound at the target player's location.
    float
    Gets the pitch of the sound.
    org.bukkit.Sound
    Gets the sound that will be played.
    float
    Gets the volume of the sound.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SoundAction

      public SoundAction(org.bukkit.Sound sound, float volume, float pitch)
      Constructs a SoundAction with the specified sound, volume, and pitch.
      Parameters:
      sound - The sound to be played.
      volume - The volume of the sound.
      pitch - The pitch of the sound.
  • Method Details

    • getSound

      public org.bukkit.Sound getSound()
      Gets the sound that will be played.
      Returns:
      The sound.
    • getVolume

      public float getVolume()
      Gets the volume of the sound.
      Returns:
      The volume.
    • getPitch

      public float getPitch()
      Gets the pitch of the sound.
      Returns:
      The pitch.
    • execute

      public void execute(org.bukkit.entity.Player target)
      Executes the action, playing the sound at the target player's location.
      Specified by:
      execute in class Action
      Parameters:
      target - The player who will hear the sound.