Class PlayableSound

java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.file.PlayableSound
All Implemented Interfaces:
Statable

public class PlayableSound extends xyz.srnyx.javautilities.parents.Stringable implements Statable
Represents a Sound with a category, volume, pitch
Also has playing methods using XSound
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    com.cryptomorin.xseries.XSound.Category
    The SoundCategory to play the XSound in
    float
    The pitch to play the XSound at
    @NotNull com.cryptomorin.xseries.XSound
    The Sound to play as a XSound
    float
    The volume to play the XSound at
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayableSound(@NotNull com.cryptomorin.xseries.XSound sound)
    Creates a new PlayableSound object with a volume and pitch of 1
    PlayableSound(@NotNull com.cryptomorin.xseries.XSound sound, float volume, float pitch)
    Creates a new PlayableSound object
    PlayableSound(@NotNull com.cryptomorin.xseries.XSound sound, com.cryptomorin.xseries.XSound.Category category)
    1.11+ Creates a new PlayableSound object with a volume and pitch of 1
    PlayableSound(@NotNull com.cryptomorin.xseries.XSound sound, com.cryptomorin.xseries.XSound.Category category, @Nullable Float volume, @Nullable Float pitch)
    1.11+ Creates a new PlayableSound object
    PlayableSound(@NotNull org.bukkit.Sound sound)
     
    PlayableSound(@NotNull org.bukkit.Sound sound, float volume, float pitch)
     
    PlayableSound(@NotNull org.bukkit.Sound sound, @Nullable Enum<?> category)
     
    PlayableSound(@NotNull org.bukkit.Sound sound, @Nullable Enum<?> category, @Nullable Float volume, @Nullable Float pitch)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    play(@NotNull org.bukkit.Location location)
    Plays the Sound at the given Location
    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
    @NotNull Map<String,Object>
    Overrides Statable.toStatValue() if non-null

    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

    Methods inherited from interface xyz.srnyx.annoyingapi.stats.Statable

    toStatValue
  • Field Details

    • sound

      @NotNull public @NotNull com.cryptomorin.xseries.XSound sound
      The Sound to play as a XSound
    • category

      @NotNull public com.cryptomorin.xseries.XSound.Category category
      The SoundCategory to play the XSound in
    • volume

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

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

    • PlayableSound

      public PlayableSound(@NotNull @NotNull com.cryptomorin.xseries.XSound sound, @Nullable com.cryptomorin.xseries.XSound.Category category, @Nullable @Nullable Float volume, @Nullable @Nullable 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 com.cryptomorin.xseries.XSound sound, @Nullable com.cryptomorin.xseries.XSound.Category 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 com.cryptomorin.xseries.XSound sound, float volume, float pitch)
      Creates a new PlayableSound object
      Parameters:
      sound - sound
      volume - volume
      pitch - pitch
    • PlayableSound

      public PlayableSound(@NotNull @NotNull com.cryptomorin.xseries.XSound sound)
      Creates a new PlayableSound object with a volume and pitch of 1
      Parameters:
      sound - sound
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound, @Nullable @Nullable Enum<?> category, @Nullable @Nullable Float volume, @Nullable @Nullable Float pitch)
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound, @Nullable @Nullable Enum<?> category)
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound, float volume, float pitch)
    • PlayableSound

      public PlayableSound(@NotNull @NotNull org.bukkit.Sound sound)
  • Method Details

    • play

      public void play(@NotNull @NotNull org.bukkit.Location location)
      Plays the Sound at the given Location
      Parameters:
      location - the Location to play the Sound at
    • 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
    • toStatMap

      @NotNull public @NotNull Map<String,Object> toStatMap()
      Description copied from interface: Statable
      Overrides Statable.toStatValue() if non-null
      Specified by:
      toStatMap in interface Statable