PreStopSoundEvent
The PreStopSoundEvent
is a custom event class in the MelodyMine plugin. This event is triggered before a sound is stopped in the client. It provides information about the sound that is about to be stopped, whether the sound is being sent to all players, and the socket ID of the player who initiated the stop sound action.
Class Properties
Property | Type | Description |
---|---|---|
|
| The name of the sound that is about to be stopped. |
|
| Indicates whether the sound is being sent to all players. |
|
| The socket ID of the player who initiated the stop sound action. This could be null. |
Example Usage
Here is an example of how to listen to this event using the Bukkit event API in Java:
In this example, we create a listener for the PreStopSoundEvent
. When the event is triggered, we retrieve the sound name, whether the sound is being sent to all players, and the socket ID of the player who initiated the stop sound action. We then log this information to the console.
Remember to register your event listener in your plugin's onEnable
method for it to work correctly.
Last updated