PreEnableAdminModeEvent
The PreEnableAdminModeEvent
is a custom event in the Bukkit API that is called before a player's admin mode is enabled in the MelodyMine plugin. This event is cancellable, which means you can prevent the admin mode from being enabled based on certain conditions in your plugin.
Event Details
melodyPlayer
The MelodyPlayer
instance representing the player for whom the admin mode is about to be enabled.
Example Usage
Here is an example of how to listen to this event in a Bukkit plugin:
In this example, we're listening for the PreEnableAdminModeEvent
. When the event is triggered, we log the name of the player for whom the admin mode is about to be enabled. If the player's name is "NotAdmin", we cancel the event to prevent the admin mode from being enabled for this player.
Remember to register your event listener in your plugin's onEnable()
method to ensure that your plugin listens for the PreEnableAdminModeEvent
.
Last updated