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:
Method | Type | Information |
getName() | String | The username of the player being jailed |
getDate() | String | Date when jail command issued, following the format: "yyyy-MM-dd HH:mm:ss" |
getJailer() | String | The username of the player that issued the command |
getReason() | String | The reason for being jailed. This string will be empty ("") if no reason was given |
getDuration() | long | The 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 |
You should update to the new event system. It allows people to use an
onJailEvent
type thing rather than using custom events. Quite nice.@imjake9
I've been away and didn't notice they changed things D:
I just updated now, but thanks for telling me. And I do agree, it is pretty nice.