Threading for FairPlay API Listeners

Violation callbacks run on the detection thread. Keep callbacks short, move blocking work off-thread, and schedule entity or region operations with the owning scheduler.

Callback ownership

Violation listeners run on FairPlay’s detection thread, which may be a PacketEvents/Netty thread. Treat callbacks as packet-side handlers, not Bukkit main-thread callbacks.

Work type and safe handoff

Work type and safe handoff
WorkDocumented handling
Inspect callback dataUse the provided violation/check data; keep callback logic short.
Entity or player operationSchedule through the entity scheduler.
Location or world operationSchedule through the region scheduler.
Blocking I/OMove to asynchronous execution.
Subscription cleanupClose FairPlaySubscription on plugin disable; automatic cleanup is also documented.

Folia and ownership

Use the entity scheduler for entity/player work and the region scheduler for location/world work. Do not access or mutate Bukkit world, block, entity, inventory, or player state directly from the callback.

Avoid changing detection outcomes accidentally

Returning true from the listener changes violation recording/punishment behavior. A MONITOR listener return value is ignored. Keep event observation and event cancellation responsibilities explicit, and do not assume cancellation reverses earlier check-local actions.

Browse all documentation