Skip to main content
The Maintenance interface is the primary entry point for interacting with the Maintenance plugin. It provides methods to control maintenance mode, access settings, and manage debug mode.

Obtaining the API Instance

Get the API instance using the MaintenanceProvider:

Methods

setMaintenance

Enables or disables maintenance mode. When enabled, all non-permitted players will be kicked.
boolean
required
true to enable maintenance mode, false to disable it
void
This method does not return a value
If using the BungeeCord version with Redis enabled, the maintenance state will also be written to the database.

isMaintenance

Checks if maintenance mode is currently enabled.
boolean
true if maintenance is currently enabled, false otherwise

isTaskRunning

Checks if a start or end timer task is currently running.
boolean
true if a timer task is currently running, false otherwise

getVersion

Returns the version of the Maintenance plugin.
String
The plugin version string

getSettings

Returns the Settings instance for accessing configuration and whitelist management.
Settings
The Settings instance
See the Settings API documentation for more details.

getEventManager

Returns the EventManager instance for registering listeners to maintenance events.
EventManager
The EventManager instance

isDebug

Checks if debug mode is enabled.
boolean
true if debug mode is enabled, false otherwise
Debug mode is currently only implemented on the BungeeCord version.

setDebug

Enables or disables debug mode.
boolean
required
true to enable debug mode, false to disable it
void
This method does not return a value

Complete Example

Here’s a complete example demonstrating common API usage: