Class SoundUtils

java.lang.Object
ch.njol.skript.bukkitutil.SoundUtils

public final class SoundUtils extends Object
Utility class for working with sounds.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable org.bukkit.NamespacedKey
    getKey(String soundString)
    Gets the key of a sound, given its enum-name-style name.
    static @NotNull org.bukkit.NamespacedKey
    getKey(org.bukkit.Sound sound)
    returns the key string for a sound.
    static @Nullable org.bukkit.Sound
    getSound(String soundString)
    Retrieves the sound correlating to the provided soundString

    Methods inherited from class java.lang.Object

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

    • SoundUtils

      public SoundUtils()
  • Method Details

    • getKey

      @Nullable public static @Nullable org.bukkit.NamespacedKey getKey(String soundString)
      Gets the key of a sound, given its enum-name-style name.
      Parameters:
      soundString - The enum name to use to find the sound.
      Returns:
      The key of the sound.
    • getKey

      @NotNull public static @NotNull org.bukkit.NamespacedKey getKey(org.bukkit.Sound sound)
      returns the key string for a sound. For version compat.
      Parameters:
      sound - The sound to get the key string of.
      Returns:
      The key string of the NamespacedKey of the sound.
    • getSound

      @Nullable public static @Nullable org.bukkit.Sound getSound(String soundString)
      Retrieves the sound correlating to the provided soundString
      Parameters:
      soundString - The string to get the correlating sound
      Returns:
      The correlating Sound