PreEnableVoiceEvent
The PreEnableVoiceEvent
is a custom event in the Bukkit API. It is triggered before a player enables their voice in the MelodyMine plugin. This event provides information about the player and the target socket ID.
Event Details
playerName
String
The name of the player who is about to enable their voice.
playerUuid
String
The UUID of the player who is about to enable their voice.
playerServer
String
The server that the player is currently on.
targetSocketID
String
The socket ID of the target player.
Methods
getPlayer()
MelodyPlayer
Returns the MelodyPlayer
instance of the player who is about to enable their voice.
getTargetPlayer()
MelodyPlayer
Returns the MelodyPlayer
instance of the target player.
Example Usage
Here is an example of how to listen to this event using the Bukkit event API:
In this example, we create a listener for the PreEnableVoiceEvent
. When the event is triggered, we retrieve the player's name and the target socket ID, and 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