Event classes
Every event Venus publishes, what it carries and whether cancelling it does anything.
Base types
| Signature | Description |
|---|---|
VenusApiEvent | Root of the hierarchy. timestamp() and instant(): when the event was created. |
CancellableVenusEvent | Adds cancelled(), setCancelled(boolean) and the fluent cancelled(boolean). |
UserEvent | Adds user(). Not cancellable. |
UserCancellableEvent | A user event that can be cancelled. |
UserCancellableCheckEvent | Adds check() and violationLevel(). |
User lifecycle
| Signature | Description |
|---|---|
UserJoinEvent | Fired after Venus starts tracking a connecting player, before any check has run. Cancelling has no effect. |
UserQuitEvent | Fired after the player disconnected and the session was closed and written. |
Detections
| Signature | Description |
|---|---|
ViolationEvent | A check recorded a violation. check(), violationLevel(), verbose(), experimental(). |
DetectionAlertEvent | An alert was rendered, before staff see it. check(), violationLevel(), message(), action(). |
VerboseEvent | A verbose line, independent of the alert stream. message() and output() tell you what was rendered and whether it was printed. |
CloudDetectionEvent | A cloud check reported a detection. type(), tags(), confidence(), message(). |
Inherits from UserCancellableCheckEvent or UserCancellableEvent. All four are cancellable, and cancelling stops the outcome: no flag is counted, no alert is sent, no cloud verdict is applied.
Mitigations and kicks
| Signature | Description |
|---|---|
MitigationEvent | A correction was applied. mitigation() names it (setback, resync, veto). |
OrdinaryKickEvent | Any kick that is not a check punishment: high ping, transaction timeout, a refused client brand, or an API call. reason() and apiInitiated(). |
Punishments
| Signature | Description |
|---|---|
PunishmentEvent | Fired before a punishment runs. type() is a PunishmentType, reason() the rendered text, check() the check that caused it (null for API-initiated punishments). |
QueuePunishmentEvent | Fired when a punishment is scheduled rather than executed, e.g. a delayed ban. delayMs(). |
The one that keeps a player connected
OrdinaryKickEvent is the hook for "do not kick this player". It is fired from the single place in the core that drops a connection, which means it covers every kick path rather than only the ones a plugin happens to know about.
api.events().repository().register(OrdinaryKickEvent.class, event -> {
if (event.apiInitiated()) {
// Our own plugin asked for this kick; let it through.
return;
}
if (event.user().getTransactionPing() < 2000) {
// The kick came from a timeout or a ping decision, but the player
// is reachable right now. Give them another chance.
event.setCancelled(true);
}
});Reading a flag end to end
ViolationEventis where the flag is decided. Cancel it to drop the evidence entirely — a cosmetic or teleport plugin might do this for one check.DetectionAlertEventis where the alert text exists. Cancel it to keep the flag but stay silent, for example in a private arena.PunishmentEventis where the consequence is decided. Cancel it to keep the flag and the alert while leaving the player in the game.