chrosticey

Create a Minecraft (Paper/Spigot) authentication plugin with a INVENTORY GUI-based login/register system.

======================== CORE SYSTEM ========================

  • First join → must register
  • Every join → must login instantly
  • INVENTORY GUI opens immediately on join

======================== INVENTORY GUI SYSTEM ========================

  • Title: "§6§lAUTHENTICATION"
  • Size: 27 slots
  • Cannot be closed until authenticated

Layout:

  • 0–8 → Glass panes (decoration)
  • 11 → Register
  • 13 → Info
  • 15 → Login
  • 22 → Help

======================== INPUT SYSTEM ========================

  • Use Anvil INVENTORY GUI or chat input
  • Register:

→ password + confirm

  • Login:

→ password

======================== PLAYER RESTRICTIONS ======================== While not logged in:

  • No movement
  • No commands (except auth)
  • No chat (except auth)
  • No block interaction
  • No inventory usage

Teleport player to spawn while logging in

======================== TELEPORT SYSTEM ========================

  • Save last location
  • After login → teleport back

======================== SUCCESS FEEDBACK ======================== Login:

  • "§a§lLOGGED IN SUCCESSFULLY"

Register:

  • "§b§lREGISTERED SUCCESSFULLY"

======================== SECURITY ========================

  • Store hashed password
  • Store IP
  • Kick if IP mismatch (before join)
  • Max attempts (config)
  • Timeout system

======================== OPTIONAL FEATURES (CONFIG) ========================

features:

ip-protection: true

auto-login: enabled: false same-ip-only: true

premium-bypass: true

captcha: enabled: false type: "MATH"

two-factor: enabled: false

anti-bot: enabled: true max-joins-per-second: 5

bossbar: enabled: true text: "§cTime left: %time%s"

INVENTORY GUI-animation: enabled: true

login-history: enabled: true

max-attempts: 3 timeout-seconds: 60

======================== 🧪 TESTING & DEBUG SYSTEM ========================

Add a full testing mode for developers/admins.

config.yml:

debug: enabled: true bypass-login-permission: "auth.debug" log-to-console: true show-detailed-errors: true

TEST FEATURES:

  1. Debug Mode:
  • When enabled:

→ Print all auth events in console: - Player join - Register attempt - Login success/failure - IP mismatch → Show debug messages to admins in-game

  1. Bypass Login:
  • Players with permission "auth.debug":

→ Skip login system → Directly join server

  1. Test Commands:

/auth test login <player> → Force open login INVENTORY GUI for player

/auth test register <player> → Force open register INVENTORY GUI

/auth test success <player> → Simulate successful login (for testing teleport/title)

/auth test fail <player> → Simulate failed login

/auth test lock <player> → Freeze player (simulate pre-login state)

/auth test unlock <player> → Remove restrictions

  1. Reset System:

/auth reset <player> → Clears password, IP, last location

  1. Fake IP Test:

/auth test ip <player> <ip> → Simulate IP mismatch to test kick system

  1. Timer Test:

/auth test timeout <player> → Force timeout kick

  1. INVENTORY GUI Reload:

/auth reload → Reload config + INVENTORY GUI without restart

======================== DATA STORAGE ======================== Store:

  • UUID
  • Username
  • Hashed password
  • IP
  • Last location

======================== ADMIN COMMANDS ========================

  • /auth reload
  • /auth reset <player>
  • /auth unregister <player>

======================== PERFORMANCE ========================

  • Async database
  • No lag / no blocking main thread

======================== COMPATIBILITY ========================

  • Latest Paper/Spigot
Kodari AI
KodariApr 9 at 6:55 pm 18,127 (v2)

I’ll create a comprehensive authentication plugin with an inventory GUI-based login/register system.

SecureAuth
A comprehensive authentication system with interactive inventory GUI-based login and registration. Features include password hashing, IP protection, movement restrictions, automatic teleportation, configurable security options including 2FA, captcha, anti-bot protection, bossbar timer, and a full debug/testing suite for developers. Players are frozen and must authenticate through a custom GUI before accessing the server.

SecureAuth plugin created successfully with comprehensive authentication system!

Features Implemented:

✅ Inventory GUI-based authentication (register/login buttons)
✅ Chat input system for password entry with confirmation
✅ Complete player restrictions (movement, chat, commands, interactions)
✅ Location saving/restoration after authentication
✅ BCrypt password hashing for security
✅ IP protection with mismatch detection
✅ Failed attempt tracking with configurable max attempts
✅ Timeout system with automatic kick
✅ Boss bar countdown timer
✅ Anti-bot protection (joins per second limit)
✅ Login history tracking
✅ Debug mode with bypass permission
✅ Test commands for developers (/auth test login/lock/unlock)
✅ Admin commands (reload, reset, unregister)
✅ Async data storage for performance

All components use XSeries for compatibility, Lombok for clean code, and proper manager separation. Players are frozen on join and must authenticate through the GUI before they can play.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
IMPORTANT.txt
manifest.kod
Code
28 1,455
src/main/java/com/secureauth/secureauth/SecureAuth.java
package com.secureauth.secureauth;

import com.secureauth.secureauth.commands.AuthCommand;
import com.secureauth.secureauth.data.AuthDataManager;
import com.secureauth.secureauth.inventory.gui.GUIListener;
import com.secureauth.secureauth.inventory.gui.GUIManager;
import com.secureauth.secureauth.listeners.*;
import com.secureauth.secureauth.managers.*;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SecureAuth extends JavaPlugin {
    
    @Getter
    private static SecureAuth instance;
    
    private GUIManager guiManager;
    private AuthDataManager authDataManager;
    private RestrictionManager restrictionManager;
    private TeleportManager teleportManager;
    private SessionManager sessionManager;
    private AntiBotManager antiBotManager;
    private AuthManager authManager;
    
    @Override
    public void onEnable() {
        instance = this;
        
        saveDefaultConfig();
        
        this.guiManager = new GUIManager();
        this.authDataManager = new AuthDataManager(this);
        this.restrictionManager = new RestrictionManager(this);
        this.teleportManager = new TeleportManager(this);
        this.sessionManager = new SessionManager(this);
        this.antiBotManager = new AntiBotManager(this);
        this.authManager = new AuthManager(this);
        
        registerListeners();
        registerCommands();
        
        getLogger().info("SecureAuth enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        if (authDataManager != null) {
            authDataManager.saveAll();
        }
        getLogger().info("SecureAuth disabled successfully!");
    }
    
    private void registerListeners() {
        PluginManager pm = Bukkit.getPluginManager();
        pm.registerEvents(new GUIListener(guiManager), this);
        pm.registerEvents(new PlayerJoinListener(this), this);
        pm.registerEvents(new PlayerQuitListener(this), this);
        pm.registerEvents(new PlayerMoveListener(this), this);
        pm.registerEvents(new PlayerChatListener(this), this);
        pm.registerEvents(new PlayerCommandListener(this), this);
        pm.registerEvents(new PlayerInteractListener(this), this);
    }
    
    private void registerCommands() {
        getCommand("auth").setExecutor(new AuthCommand(this));
    }
    
    public void debug(String message) {
        if (getConfig().getBoolean("debug.enabled") && getConfig().getBoolean("debug.log-to-console")) {
            getLogger().info("[DEBUG] " + message);
        }
    }
}