Venusanticheat docs

Event classes

Every event Venus publishes, what it carries and whether cancelling it does anything.

Base types

package xyz.kaosmc.anticheat.api.event
SignatureDescription
VenusApiEventRoot of the hierarchy. timestamp() and instant(): when the event was created.
CancellableVenusEventAdds cancelled(), setCancelled(boolean) and the fluent cancelled(boolean).
UserEventAdds user(). Not cancellable.
UserCancellableEventA user event that can be cancelled.
UserCancellableCheckEventAdds check() and violationLevel().

User lifecycle

SignatureDescription
UserJoinEventFired after Venus starts tracking a connecting player, before any check has run. Cancelling has no effect.
UserQuitEventFired after the player disconnected and the session was closed and written.

Detections

SignatureDescription
ViolationEventA check recorded a violation. check(), violationLevel(), verbose(), experimental().
DetectionAlertEventAn alert was rendered, before staff see it. check(), violationLevel(), message(), action().
VerboseEventA verbose line, independent of the alert stream. message() and output() tell you what was rendered and whether it was printed.
CloudDetectionEventA 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

SignatureDescription
MitigationEventA correction was applied. mitigation() names it (setback, resync, veto).
OrdinaryKickEventAny kick that is not a check punishment: high ping, transaction timeout, a refused client brand, or an API call. reason() and apiInitiated().

Punishments

SignatureDescription
PunishmentEventFired before a punishment runs. type() is a PunishmentType, reason() the rendered text, check() the check that caused it (null for API-initiated punishments).
QueuePunishmentEventFired 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.

java
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

  • ViolationEvent is where the flag is decided. Cancel it to drop the evidence entirely — a cosmetic or teleport plugin might do this for one check.
  • DetectionAlertEvent is where the alert text exists. Cancel it to keep the flag but stay silent, for example in a private arena.
  • PunishmentEvent is where the consequence is decided. Cancel it to keep the flag and the alert while leaving the player in the game.