Class PlayableSound

java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.file.PlayableSound

public class PlayableSound extends xyz.srnyx.javautilities.parents.Stringable
Represents a Sound with a volume and pitch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    @Nullable Object
    The SoundCategory to play the Sound in
    float
    The pitch to play the Sound at
    @NotNull org.bukkit.Sound
    The Sound to play
    float
    The volume to play the Sound at
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayableSound(@NotNull org.bukkit.Sound sound)
    Creates a new PlayableSound object with a volume and pitch of 1
    PlayableSound(@NotNull org.bukkit.Sound sound, float volume, float pitch)
    Creates a new PlayableSound object
    PlayableSound(@NotNull org.bukkit.Sound sound, @Nullable Object category)
    1.11+ Creates a new PlayableSound object with a volume and pitch of 1
    PlayableSound(@NotNull org.bukkit.Sound sound, @Nullable Object category, float volume, float pitch)
    1.11+ Creates a new PlayableSound object
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    play(@Nullable org.bukkit.World world)
    Plays the Sound in the given World at the world's spawn
    void
    play(@Nullable org.bukkit.World world, @Nullable org.bukkit.Location location)
    Plays the Sound at the given Location in the given World
    void
    play(@NotNull org.bukkit.entity.Player player)
    Plays the Sound to the given Player at the player's location
    void
    play(@NotNull org.bukkit.entity.Player player, @Nullable org.bukkit.Location location)
    Plays the Sound to the given Player at the given Location

    Methods inherited from class xyz.srnyx.javautilities.parents.Stringable

    toString, toString, toString, toString, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • sound

      @NotNull public @NotNull org.bukkit.Sound sound
      The Sound to play
    • category

      @Nullable public @Nullable Object category
      The SoundCategory to play the Sound in
    • volume

      public float volume
      The volume to play the Sound at
    • pitch

      public float pitch
      The pitch to play the Sound at
  • Constructor Details

    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound, @Nullable @Nullable Object category, float volume, float pitch)
      1.11+ Creates a new PlayableSound object
      Parameters:
      sound - sound
      category - category
      volume - volume
      pitch - pitch
      See Also:
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound, @Nullable @Nullable Object category)
      1.11+ Creates a new PlayableSound object with a volume and pitch of 1
      Parameters:
      sound - sound
      category - category
      See Also:
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound, float volume, float pitch)
      Creates a new PlayableSound object
      Parameters:
      sound - sound
      volume - volume
      pitch - pitch
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound)
      Creates a new PlayableSound object with a volume and pitch of 1
      Parameters:
      sound - sound
  • Method Details

    • play

      public void play(@Nullable @Nullable org.bukkit.World world, @Nullable @Nullable org.bukkit.Location location)
      Plays the Sound at the given Location in the given World
      Parameters:
      world - the World to play the Sound in, or null to play in the default world
      location - the Location to play the Sound at, or null to play at the world's spawn
    • play

      public void play(@Nullable @Nullable org.bukkit.World world)
      Plays the Sound in the given World at the world's spawn
      Parameters:
      world - the World to play the Sound in
    • play

      public void play(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.Location location)
      Plays the Sound to the given Player at the given Location
      Parameters:
      player - the Player to play the Sound to
      location - the Location to play the Sound at, or null to play at the player's location
    • play

      public void play(@NotNull @NotNull org.bukkit.entity.Player player)
      Plays the Sound to the given Player at the player's location
      Parameters:
      player - the Player to play the Sound to