PrePauseSoundEvent
Class Properties
Property
Type
Description
Class Methods
Method
Return Type
Description
Example Usage
import ir.taher7.melodymine.api.events.PrePauseSoundEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class ExampleListener implements Listener {
@EventHandler
public void onPrePauseSound(PrePauseSoundEvent event) {
// Check if the event is cancelled
if (event.isCancelled()) {
return;
}
// Get the sound name
String soundName = event.getSoundName();
// Log the sound name to the console
Bukkit.getLogger().info("About to pause sound: " + soundName);
// If the event is set to send to all, log this information
if (event.isSendToAll()) {
Bukkit.getLogger().info("The sound pause will be sent to all players.");
}
// Get the socket ID, if it exists
String socketID = event.getSocketID();
if (socketID != null) {
Bukkit.getLogger().info("The socket ID associated with this event is: " + socketID);
}
}
}Last updated