Skip to main content

Getting the API Instance

The Maintenance API is accessed through the MaintenanceProvider class:
The MaintenanceProvider.get() method may return null if the Maintenance plugin hasn’t loaded yet. Always check for null before using the API.

Checking Maintenance Status

You can check if maintenance mode is currently enabled:

Enabling and Disabling Maintenance

Control maintenance mode programmatically:
When maintenance is enabled, all non-whitelisted players are automatically kicked from the server. On BungeeCord with Redis enabled, the status is also written to the database.

Managing the Whitelist

Add and remove players from the maintenance whitelist:

Complete Plugin Example

Here’s a complete example plugin that integrates with the Maintenance API:

Accessing Settings

The Settings interface provides access to configuration options:

Next Steps

Event Listeners

Listen to maintenance events in your plugin

Proxy Integration

Manage per-server maintenance on proxy networks