Package org.geysermc.geyser.util
Class SoundUtils
java.lang.Object
org.geysermc.geyser.util.SoundUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidplaySound(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 clientstatic StringreadSoundEvent(org.cloudburstmc.nbt.NbtMap data, String context) static @Nullable org.cloudburstmc.protocol.bedrock.data.SoundEventtoSoundEvent(String sound) Maps a sound name to a sound event, null if one does not exist.static StringtranslatePlaySound(String javaIdentifier) Translates a Java Custom or Builtin Sound to its Bedrock equivalent
-
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
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 playposition- the positionpitch- the pitch
-
readSoundEvent
-