Custom Events for Plugin Developers

KarmicJail throws a custom event whenever someone is jailed. Plugin developers can listen for this event and grab important info regarding the jail event.

So in your class that implements Listener you'll want to handle for the JailEvent type of event
Ex/

 @EventHandler
    public void playerJailed(KarmicJailEvent event) {
        // Some code here
    }

After that, you can grab the information from the event itself. The event contains the following variables and appropriate information:

MethodTypeInformation
getName()StringThe username of the player being jailed
getDate()StringDate when jail command issued, following the format: "yyyy-MM-dd HH:mm:ss"
getJailer()StringThe username of the player that issued the command
getReason()StringThe reason for being jailed. This string will be empty ("") if no reason was given
getDuration()longThe length of time they're in jail. If zero or negative, they're jailed indefinitely. Please note, that it is stored as ticks to minutes. So to convert to regular minutes, divide by 1200

Comments

Posts Quoted:
Reply
Clear All Quotes