crazyxanshu

Generate a professional, production-ready Minecraft plugin in Java (Java 21) using the latest Paper/Spigot/Purpur APIs, following modern software engineering, security, optimization, and clean architecture best practices.

Plugin Name: SecureLogin Version: 1.0.0 Author: DilshantGamerz

Requirements:

  • Support Minecraft 1.21.x+ (future-compatible whenever possible).
  • Create a secure login/register system for offline (cracked) servers.
  • Store all player data in plugins/SecureLogin/players.yml (NO MySQL or SQLite).
  • Store passwords using BCrypt hashing only (never plain text).
  • First join: require /register <password> <confirmPassword>.
  • Returning players: require /login <password>.
  • Auto-login immediately after successful registration.
  • Add /changepassword <oldPassword> <newPassword> <confirmPassword>.
  • Add admin commands:

- /unregister <player> - /resetpassword <player> - /loginreload - /securelogin help - /securelogin version

  • Before login/register:

- Freeze the player. - Apply Darkness effect. - Block movement, inventory, block break/place, item usage, chat, reading chat, private messages, damage, portals, INVENTORY GUI interactions, and all commands except /login and /register.

  • Remove all restrictions immediately after successful login.
  • Kick the player after 5 incorrect password attempts.
  • Kick the player if they do not log in within 60 seconds.
  • Make all messages configurable in messages.yml.
  • Make all settings configurable in config.yml.
  • Support MiniMessage and legacy color codes.
  • Use a clean package structure, SOLID principles, modern Paper API, thread-safe file saving, proper logging, and optimized performance.
  • Do not use deprecated APIs, NMS, placeholder code, TODOs, or incomplete implementations.
  • Automatically fix bugs, compilation errors, runtime errors, and optimize the code before the final build.
  • Generate a complete project with all required files (plugin.yml, config.yml, messages.yml, players.yml, source code, and build files).

Finally, compile the project successfully and provide the final SecureLogin.jar file, fully tested, production-ready, and ready to place directly into the server's plugins folder.

Kodari AI
KodariAug 6 at 8:34 am 2
SecureLogin
SecureLogin is a comprehensive authentication plugin for offline Minecraft servers, providing robust security through BCrypt password hashing and YAML-based data storage. It features a complete registration and login system with automatic player freezing, darkness effects, and comprehensive action blocking for unauthenticated players. The plugin includes configurable timeouts, password attempt limits, and fully customizable messages through MiniMessage and legacy color codes. Administrative tools allow unregistering players, resetting passwords, and reloading configurations. Built with modern Paper API, SOLID principles, and thread-safe file operations, SecureLogin ensures optimal performance and security for cracked servers.
  1. Create the Gradle/Paper project and plugin metadata.

  2. Implement configurable messaging, settings, BCrypt-backed YAML persistence, and atomic async saves.

  3. Implement authentication flows, password changes/resets, admin commands, timeout/attempt handling, and lifecycle cleanup.

  4. Add event protections for all pre-auth interactions plus configuration/resources.

  1. Created the complete SecureLogin project with Gradle, Paper 1.21.x metadata, resources, BCrypt, and XSeries.

  2. Implemented YAML-based player storage at plugins/SecureLogin/players.yml with synchronized access, asynchronous saves, and atomic file replacement.

  3. Added registration, login, password changes, admin unregister/reset, reload, help, and version commands.

  4. Added configurable MiniMessage/legacy messaging, authentication timeout, failed-attempt limits, Darkness, freeze, and pre-auth interaction restrictions.

  5. Added lifecycle cleanup and configuration/resource files.

I could not compile or provide a SecureLogin.jar because this environment does not provide the Gradle/build toolchain or artifact packaging capability.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
15 1,198
src/main/java/com/dilshantgamerz/securelogin/SecureLoginPlugin.java
package com.dilshantgamerz.securelogin;

import com.dilshantgamerz.securelogin.auth.AuthenticationManager;
import com.dilshantgamerz.securelogin.command.CommandRouter;
import com.dilshantgamerz.securelogin.config.SettingsManager;
import com.dilshantgamerz.securelogin.listener.AuthenticationListener;
import com.dilshantgamerz.securelogin.message.MessageService;
import com.dilshantgamerz.securelogin.storage.PlayerRepository;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class SecureLoginPlugin extends JavaPlugin {
    private SettingsManager settings;
    private MessageService messages;
    private PlayerRepository playerRepository;
    private AuthenticationManager authentication;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("players.yml", false);

        settings = new SettingsManager(this);
        messages = new MessageService(this, settings);
        playerRepository = new PlayerRepository(this);
        playerRepository.load();
        authentication = new AuthenticationManager(this, settings, messages, playerRepository);

        AuthenticationListener listener = new AuthenticationListener(authentication, messages, settings);
        Bukkit.getPluginManager().registerEvents(listener, this);

        CommandRouter commands = new CommandRouter(this, authentication, messages, playerRepository);
        getCommand("register").setExecutor(commands);
        getCommand("login").setExecutor(commands);
        getCommand("changepassword").setExecutor(commands);
        getCommand("unregister").setExecutor(commands);
        getCommand("resetpassword").setExecutor(commands);
        getCommand("loginreload").setExecutor(commands);
        getCommand("securelogin").setExecutor(commands);
        getCommand("register").setTabCompleter(commands);
        getCommand("login").setTabCompleter(commands);
        getCommand("changepassword").setTabCompleter(commands);
        getCommand("unregister").setTabCompleter(commands);
        getCommand("resetpassword").setTabCompleter(commands);
        getCommand("loginreload").setTabCompleter(commands);
        getCommand("securelogin").setTabCompleter(commands);
    }

    @Override
    public void onDisable() {
        if (authentication != null) {
            authentication.shutdown();
        }
        if (playerRepository != null) {
            playerRepository.saveSync();
        }
    }

    public void reloadFiles() {
        reloadConfig();
        settings.reload();
        messages.reload();
        playerRepository.reload();
    }
}