Interface SoundManager
public interface SoundManager
Provides a platform-independent way to play sounds in BuildMC.
This interface abstracts away differences between server implementations (Paper vs Spigot) so that plugins and addons can play sounds without worrying about platform-specific APIs.
-
Method Summary
Modifier and TypeMethodDescriptionvoidplaySound(@NotNull org.bukkit.Location location, @NotNull net.kyori.adventure.sound.Sound sound) Plays a sound at a specific location in the world.voidplaySound(@NotNull org.bukkit.entity.Player player, @NotNull net.kyori.adventure.sound.Sound sound) Plays a sound to a specific player.
-
Method Details
-
playSound
void playSound(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull net.kyori.adventure.sound.Sound sound) Plays a sound to a specific player.Only the given player will hear the sound.
- Parameters:
player- the player to hear the soundsound- theSoundto play
-
playSound
void playSound(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull net.kyori.adventure.sound.Sound sound) Plays a sound at a specific location in the world.All players within audible range of the location will hear the sound.
- Parameters:
location- theLocationwhere the sound should be playedsound- theSoundto play
-