Events
Events
Honeypot publishes nine separate events for plugins to listen to. Each event (except one) is has two types: the regular variant, and a "Pre" variant.
The regular variant is called after the corresponding trigger is processed, while the "Pre" version is called before the corresponding trigger is processed. Consequently, only the "Pre" variant is cancellable.
Event Name | Description | Cancellable |
---|---|---|
| Called when a Honeypot is about to be created, regardless of if the creation would be successful. If cancelled the Honeypot creation is also cancelled. | Yes |
| Called after, and only after, a Honeypot is successfully created | No |
| Called before Honeypot processes an action from a Honeypot block the player broke. If cancelled, the Honeypot block will break just like any other Minecraft block without consequences. | Yes |
| Called after Honeypot finishes processing an action from a Honeypot block triggered by a player breaking it | No |
| A unique event which does not have a "Pre" variant, this event is called when a non-player entity or block takes attempts to modify a Honeypot (pistons, fire, TNT, creepers, etc.). A player may have caused this event to trigger, but the actual object doing the modification was not the player (Such as TNT ignited by the player. The TNT did the actual modification, but the player caused it) | No |
| Called before Honeypot processes an action from a Honeypot container the player interacted with. The player may have permission to bypass the event, so this event doesn't necessarily indicate a successful Honeypot trigger. If cancelled, Honeypot will cease further processing of the event, allowing the player to interact as normal without consequences. | Yes |
| Called after Honeypot finishes processing an interact event. This event is always called at the end of processing, whether action was taken or not (Such as if the player had bypass permission). | No |
| Called before Honeypot processes an action from a Honeypot container in which the player clicked inside its inventory. If cancelled, Honeypot will stop processing the event and the event will be allowed as normal. | Yes |
| Called after Honeypot finishes processing an inventory click event. Unlike HoneypotInteractEvent, this event is only called upon successful processing of an inventory click action. This may change in the future to standardize behavior across events. | No |
Listening to Events
All Honeypot events are registered in the org.reprogle.honeypot.api.events
package. Here is the simplest example of listening to events from Honeypot