@Trait @CompileStatic trait CommandEvents extends Object
Allows for listening and reacting to events triggered by other commands
Type Params | Return Type | Name and description |
---|---|---|
|
void |
after(String commandName, Closure callable) Register to listen for an event that runs before the given command |
|
void |
before(String commandName, Closure callable) Register to listen for an event that runs before the given command |
|
void |
notify(String eventName, Object[] args) Notify of an event |
|
void |
on(String eventName, Closure callable) Register to listen for an event |
Register to listen for an event that runs before the given command
eventName
- The name of the eventcallable
- The closure that is executed when the event is firedRegister to listen for an event that runs before the given command
eventName
- The name of the eventcallable
- The closure that is executed when the event is firedNotify of an event
eventName
- The name of the eventargs
- The arguments to the eventRegister to listen for an event
eventName
- The name of the eventcallable
- The closure that is executed when the event is fired