Skip to content
shvquu edited this page Jun 13, 2026 · 1 revision

Events

ServerDoctor publishes events on a thread-safe EventBus you can subscribe to from your plugin. Subscribe via ServerDoctorApi.events().

Subscribing

ServerDoctorApi api = ServerDoctorProvider.get();

api.events().subscribe(AnalysisFinishedEvent.class, e -> {
    DiagnosticReport report = e.report();
    getLogger().info("Scan done, status: " + report.overallSeverity());
});

api.events().subscribe(PluginConflictDetectedEvent.class, e ->
        getLogger().warning("Conflict: " + e.conflict().description()));

A failing subscriber is isolated and logged — it never breaks other subscribers or the analysis itself.

Available events

Event Payload Fired when
AnalysisFinishedEvent report() A full diagnostic run completes
PluginConflictDetectedEvent conflict() A conflict is detected during a run
SecurityRiskDetectedEvent risk() A security/maintenance risk is detected
PerformanceThresholdReachedEvent snapshot(), severity(), reason() A performance threshold is crossed

All events extend ServerDoctorEvent and expose timestamp().

Notes

  • Subscribers may be invoked from an asynchronous thread (scans run async). If you touch the Bukkit API from a handler, schedule that work back onto the appropriate thread yourself.

Clone this wiki locally