PrePlaySoundEvent
Event Details
Property
Type
Description
Example Usage
import ir.taher7.melodymine.api.events.PrePlaySoundEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public class ExampleListener implements Listener {
private JavaPlugin plugin;
public ExampleListener(JavaPlugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onPrePlaySound(PrePlaySoundEvent event) {
String soundName = event.getSoundName();
boolean sendToAll = event.isSendToAll();
String socketID = event.getSocketID();
Double volume = event.getVolume();
plugin.getLogger().info("A sound is about to be played!");
plugin.getLogger().info("Sound Name: " + soundName);
plugin.getLogger().info("Send to All: " + sendToAll);
plugin.getLogger().info("Socket ID: " + socketID);
plugin.getLogger().info("Volume: " + volume);
}
}Last updated