-
Notifications
You must be signed in to change notification settings - Fork 1
NavigatorAPI
VelocityNavigator exposes a public API so other Velocity plugins can inspect routing decisions, health status, and plugin metadata without depending on internal implementation classes.
import com.demonz.velocitynavigator.NavigatorAPI;
import com.demonz.velocitynavigator.NavigatorAPIProvider;
NavigatorAPI api = NavigatorAPIProvider.get();
if (api == null) {
// VelocityNavigator is not loaded
return;
}The provider returns null when VelocityNavigator is absent. Register your plugin as a @Dependency in your @Plugin annotation to ensure it loads after VelocityNavigator.
These methods provide direct access to plugin state without casting to VelocityNavigator.
| Method | Returns | Description |
|---|---|---|
pluginVersion() |
String |
VelocityNavigator version string (e.g. 4.5.0) |
server() |
ProxyServer |
The Velocity proxy instance |
logger() |
Logger |
SLF4J logger for the plugin |
dataDirectory() |
Path |
Plugin data directory (plugins/velocitynavigator/) |
config() |
Config |
Currently active parsed configuration (never null after startup) |
bedrockHandler() |
BedrockHandler |
Geyser/Floodgate integration handler |
| Method | Returns | Description |
|---|---|---|
previewRoute(Player) |
CompletableFuture<RouteDecision> |
Simulates the routing decision for a player without moving them |
getRoutingConfig() |
Config.Routing |
Current routing configuration section |
getSelectionMode() |
Config.SelectionMode |
Active selection mode (least_players, round_robin, random, power_of_two, weighted_round_robin, least_connections, consistent_hash, latency, geo) |
getRoutingDistribution() |
Map<String, Long> |
Per-server routing counts (resets every 60 seconds) |
| Method | Returns | Description |
|---|---|---|
getHealthCheckLatencies() |
Map<String, Long> |
Last known ping latency per server (milliseconds) |
getCircuitBreakerStatuses() |
Map<String, CircuitBreakerState> |
Current circuit breaker state per server (CLOSED, OPEN, HALF_OPEN) |
inspectServer(String) |
CompletableFuture<ServerHealthStatus> |
Detailed health snapshot for one server |
| Method | Returns | Description |
|---|---|---|
isGlobalMaintenance() |
boolean |
Whether network-wide maintenance is active |
isServerInMaintenance(String) |
boolean |
Whether a specific server is in maintenance |
getMaintenanceServers() |
Set<String> |
Set of server names currently in maintenance |
NavigatorAPI api = NavigatorAPIProvider.get();
if (api != null) {
Config cfg = api.config();
int maxRetries = cfg.routing().maxRetries();
List<String> lobbies = cfg.routing().defaultLobbies();
getLogger().info("Lobby pool has {} servers, {} retries max",
lobbies.size(), maxRetries);
}NavigatorAPI api = NavigatorAPIProvider.get();
api.previewRoute(player).thenAccept(decision -> {
getLogger().info("Would route {} to {} (reason: {})",
player.getUsername(),
decision.selectedServer(),
decision.reason());
});All accessor methods are safe to call from any thread. previewRoute() and inspectServer() return CompletableFuture and do not block the calling thread.
The API was expanded in 4.5.0 with the six accessor methods. Existing methods from 4.0.0+ remain unchanged. Plugins compiled against the 4.5.0 interface will work with any 4.5.x release.
Home · Quick Start · Configuration · Operations · FAQ
Website · GitHub · Support / Discord · Report a Bug
VelocityNavigator v4.5.0 · by DemonZ Development
![]()
Getting Started
Routing
- Routing Algorithms
- Algorithm Visualizations
- Initial Join Balancing
- Contextual Routing Guide
- Player Affinity
- Health & Circuit Breakers
- Retries & Fallbacks
- Geo Routing
Player Experience
- Java & Bedrock Selectors
- Selector Customization
- Backend NPCs
- Backend YAML Menus
- Language Packs
- Party System
- Capacity Queue
Configuration
- Configuration Guide
- Modular Configuration
- MOTD Configuration
- Authentication & Security
- Backend Bridge Configuration
- Migration Guide v3 → v4
- Migration Guide v4.4 → 4.5
Network & Operations
- Advanced Proxy Systems
- Redis & Multi-Proxy
- Common Core Architecture
- NavigatorAPI
- Storage & Databases
- Server Management
- Backend Lifecycle States
- Maintenance Mode
- HTML Dashboard
- Operations Runbook
- Prometheus & Grafana Setup
- Troubleshooting Guide
- FAQ
VelocityNavigator 4.5.0