-
Notifications
You must be signed in to change notification settings - Fork 3
Sound
Lorenzo Rossi edited this page Feb 28, 2018
·
1 revision
This is a minor API that helps solving common problems related to spigot sounds.
This helps translating 1.9 sounds names to 1.8 sounds instances, if the version is grater than 1.8 it could be used as a normal lookup-map. Usage:
Sound sound = CompatibleSound.get("ambient cave");// Case-insensitive and can replace spaces with _
Sound other = CompatibleSound.getRaW("AMBIENT_CAVE");// This requires the input to match exactly the enumA class that holds sound, volume and pitch in a single instance (everything changable via Placeholders)
// sound, volume, pitch
PlaySound sound = PlaySound.of(Sound.BLOCK_ANVIL_BREAK, 1.1, 1.0);
// WARNING: NOT 1.8 COMPATIBLE, use CompatibleSound in real code
sound.play(new Location(world, 0, 0, 0));
sound.play(player);