Class SoundUtils

java.lang.Object
org.geysermc.geyser.util.SoundUtils

public final class SoundUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    playSound(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch)
    Translates and plays a Java Builtin Sound for a Bedrock client
    static @Nullable org.cloudburstmc.protocol.bedrock.data.SoundEvent
    Maps a sound name to a sound event, null if one does not exist.
    static String
    translatePlaySound(String javaIdentifier)
    Translates a Java Custom or Builtin Sound to its Bedrock equivalent

    Methods inherited from class java.lang.Object

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

    • toSoundEvent

      public static @Nullable org.cloudburstmc.protocol.bedrock.data.SoundEvent toSoundEvent(String sound)
      Maps a sound name to a sound event, null if one does not exist.
      Parameters:
      sound - the sound name
      Returns:
      a sound event from the given sound
    • translatePlaySound

      public static String translatePlaySound(String javaIdentifier)
      Translates a Java Custom or Builtin Sound to its Bedrock equivalent
      Parameters:
      javaIdentifier - the sound to translate
      Returns:
      a Bedrock sound
    • playSound

      public static void playSound(GeyserSession session, org.geysermc.mcprotocollib.protocol.data.game.level.sound.Sound javaSound, org.cloudburstmc.math.vector.Vector3f position, float volume, float pitch)
      Translates and plays a Java Builtin Sound for a Bedrock client
      Parameters:
      session - the Bedrock client session.
      javaSound - the builtin sound to play
      position - the position
      pitch - the pitch