Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xreatlabs.space/llms.txt

Use this file to discover all available pages before exploring further.

Platform Support

NexAuth provides unified authentication across multiple Minecraft server platforms with platform-specific optimizations.

Supported Platforms

Velocity

High-performance proxy with cross-server authentication and unified sessions.

Paper

Advanced server software with full feature support and optimized performance.

Velocity Platform

Architecture

Velocity-Specific Features

Implementation

public class VelocityNexAuth {
    private final ProxyServer server;
    private final AuthProvider authProvider;
    private final SessionManager sessionManager;
    
    @Subscribe
    public void onPlayerJoin(PostLoginEvent event) {
        Player player = event.getPlayer();
        
        // Authenticate before server transfer
        AuthResult result = authProvider.authenticate(player);
        
        if (result.isSuccess()) {
            // Create session for backend servers
            Session session = sessionManager.createSession(player);
            
            // Transfer to backend server
            player.createConnectionRequest(server.getServer("lobby"))
                   .fireAndForget();
        } else {
            // Handle authentication failure
            player.disconnect(Component.text("Authentication failed"));
        }
    }
}

Configuration

# velocity.toml
[server-config]
# Forward player info to backend servers
player-info-forwarding = "modern"

[servers]
# Configure backend servers
lobby = "127.0.0.1:25566"
survival = "127.0.0.1:25567"
creative = "127.0.0.1:25568"

[plugins]
# NexAuth handles authentication
# Backend servers should NOT have auth plugins
# NexAuth config (Velocity)
# Premium authentication is automatically detected
online-mode=false

# Backend server settings
backend-auth-required=true
session-timeout=604800

Paper Platform

Architecture

Paper-Specific Features

Implementation

public class PaperNexAuth extends JavaPlugin {
    private AuthManager authManager;
    private SessionManager sessionManager;
    
    @Override
    public void onEnable() {
        // Initialize authentication
        authManager = new AuthManager(this);
        sessionManager = new SessionManager(this);
        
        // Register commands
        registerCommands();
        
        // Register events
        registerEvents();
    }
    
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        
        if (isBackendMode()) {
            // Verify proxy session
            verifyProxySession(player);
        } else {
            // Handle standalone authentication
            handleStandaloneAuth(player);
        }
    }
    
    @EventHandler(priority = EventPriority.LOWEST)
    public void onPlayerLogin(AsyncPlayerPreLoginEvent event) {
        // Pre-login authentication check
        String username = event.getName();
        
        if (!authManager.isRegistered(username)) {
            // Allow new player
            return;
        }
        
        // Check if player can authenticate
        if (!authManager.canAuthenticate(username)) {
            event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, 
                          "Authentication required");
        }
    }
}

Configuration

# server.properties (Paper)
online-mode=false  # NexAuth handles authentication
server-port=25566

# paper.yml (if needed)
settings:
  velocity-support:
    enabled: true  # If using Velocity
    secret: "shared_secret"
# NexAuth config (Paper)
# Platform is auto-detected, no mode setting needed

# Authentication settings
auto-register=false
max-login-attempts=-1

# Session management
session-timeout=604800
hide-player-inventory=true

Platform Comparison

FeatureVelocityPaper
Cross-Server Auth✅ Native❌ Requires Proxy
In-Game Commands⚠️ Limited✅ Full Support
Performance⚡ Highest🚀 High
Session Sharing✅ Built-in❌ Manual Setup
Plugin Compatibility✅ Backend Only✅ Most Plugins
Resource Usage💚 Lower💚 Low

Multiplatform Deployment

Network Configuration

1

Install on Velocity

Place NexAuth velocity plugin in proxy’s plugins/ folder.
2

Configure Backends

Install NexAuth paper plugin on each backend server.
3

Configure Session Sharing

Enable session sync between proxy and backends.
4

Test Authentication

Verify auth works across all backend servers.

Platform-S APIs

Velocity API

// Access Velocity-specific features
ProxyServer server = NexAuthVelocity.getProxy();

// Player management
Player player = server.getPlayer(username);

// Server transfer
player.createConnectionRequest(server.getServer("lobby"))
       .connect()
       .thenAccept(result -> {
           // Handle transfer result
       });

// Messaging
server.sendMessage(Component.text("Authentication successful"));

Paper API

// Access Paper-specific features
JavaPlugin plugin = NexAuthPaper.getPlugin();

// Player management
Player player = Bukkit.getPlayer(username);

// World management
World world = player.getWorld();
Location location = player.getLocation();

// Scheduler
Bukkit.getScheduler().runTaskLater(plugin, () -> {
    // Delayed task
}, 20L);  // 1 second delay

Performance Considerations

Velocity Performance

# Optimize for high player counts
# These are internal optimizations handled by NexAuth
# No manual configuration needed

Paper Performance

# Optimize for server performance
# These are internal optimizations handled by NexAuth
# No manual configuration needed

Debugging

Velocity Debugging

# Enable debug mode (add to server startup)
-Dnexauth.debug=3

Paper Debugging

# Enable debug mode (add to server startup)
-Dnexauth.debug=3

Migration

Paper to Velocity

1

Install Velocity

Set up Velocity proxy with NexAuth.
2

Export Data

Export player data from Paper NexAuth.
3

Import to Velocity

Import data into Velocity NexAuth.
4

Configure Backends

Set up backend servers without auth plugins.
5

Test Migration

Verify authentication and sessions work correctly.

Next Steps

Limbo Integration

Advanced integration with Limbo servers.