Skip to main content

Overview

The Maintenance Proxy API extends the base Maintenance API with additional functionality for managing maintenance mode on individual backend servers in a proxy network. This is available on BungeeCord and Velocity platforms.

Getting the Proxy API Instance

The proxy API is accessed through the same MaintenanceProvider, but cast to MaintenanceProxy:
The MaintenanceProxy interface extends Maintenance, so you have access to all base API methods plus proxy-specific functionality.

Managing Per-Server Maintenance

Control maintenance mode for individual backend servers:

Listing Servers and Maintenance Status

Get information about all registered servers:

Working with Server Objects

The Server interface provides information and actions for backend servers:
The Server.isRegisteredServer() method will return false if maintenance is disabled on a previously registered server that has been removed from the proxy.

Handling ServerMaintenanceChangedEvent

Listen for per-server maintenance changes:

Complete Proxy Plugin Example

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

Redis Integration

When Redis is enabled in the Maintenance configuration, per-server maintenance status changes are automatically synchronized across all proxy instances in your network.
The proxy API automatically handles Redis synchronization:

Best Practices

Always verify server.isRegisteredServer() before performing operations on a server, especially when handling events.
The getServerOrDummy() method is useful for ensuring you always get a Server object, but remember to check isRegisteredServer() before using it.
When running on a proxy, listen for both MaintenanceChangedEvent (global) and ServerMaintenanceChangedEvent (per-server) to handle all scenarios.
Use server.broadcast() to warn players before enabling maintenance mode on their server.

Next Steps

Basic Usage

Learn basic API operations and usage

Event Listeners

Listen to maintenance events in your plugin