Minecraft anticheat guide
FairPlay API for Server Developers
Integrate with FairPlay services and violation events while respecting cancellation behavior and callback threading.
Obtain the supported API surface
The FairPlay developer API is version 1.0.0. Plugins can look up FairPlayService through Bukkit’s ServicesManager or use the FairPlayAPI facade.
Use the documented API methods rather than internal transaction classes and packages, which are not part of the extension API. Its compatibility policy says API_VERSION follows semantic versioning and does not introduce incompatible changes within a 1.x line; newly added methods use defaults or a major version change. This policy applies to the documented API surface, not internal implementation packages.
FairPlayService service = Bukkit.getServicesManager().load(FairPlayService.class);
// Subscribe via the event-bus onViolation method; retain and close the subscription.Subscribe and clean up
A violation event subscription returns a FairPlaySubscription; close it when your plugin disables. FairPlay also documents automatic cleanup when a consumer plugin is disabled.
A listener may cancel a violation before it is recorded and punished. That cancellation does not undo check-local packet cancellation, setback, or enforcement that happened before the violation pipeline. Keep this distinction explicit in integrations.
Threading and Folia safety
Violation listeners may run on a PacketEvents or Netty detection thread. The API documentation warns consumers not to access Bukkit worlds, blocks, entities, inventories, or players directly in that callback.
Schedule entity work on the entity scheduler, location work on the region scheduler, and I/O asynchronously. Keep callbacks non-blocking. Schedule callbacks according to the server’s entity, region, or global ownership requirements and validate your integration on the server setup you operate.
FAQ
How do I obtain the service?
Retrieve FairPlayService through Bukkit's ServicesManager or the FairPlayAPI facade. Close event subscriptions when your plugin disables.
What must listeners avoid?
Never touch Bukkit worlds, blocks, entities, inventories, or players directly in the callback; schedule entity work on the entity scheduler, location work on the region scheduler, and blocking I/O asynchronously.