hama19aura

Build Complete KKSAuthMe Minecraft Plugin

Create a complete, working Minecraft authentication plugin named KKSAuthMe for Paper 1.21.11 using Java 21 and Maven.

Do not provide pseudocode, incomplete examples, or TODO placeholders. Generate every required file and ensure the project compiles.

  1. Main Requirements
  • Plugin name: KKSAuthMe
  • Main class: "com.kksauthme.KKSAuthMe"
  • Minecraft server: Paper 1.21.11
  • Java: 21
  • Default database: SQLite
  • Password hashing: BCrypt
  • Provide "pom.xml", "plugin.yml", "config.yml", and every required Java source file.
  1. Premium Account Protection — MOST IMPORTANT

The server must distinguish genuine Premium accounts from cracked clients.

  • Genuine Minecraft Premium players must be authenticated by Minecraft's official authentication system.
  • Premium players must not need "/login" or "/register".
  • A cracked player must not be able to join using the username of a Premium player.
  • Never trust a username alone to determine whether a player owns a Premium account.
  • Never allow an offline-mode connection to bypass Premium verification.
  • Require "online-mode=true" for direct server connections, or use a correctly configured and trusted authentication proxy if proxy networking is required.
  • Explain all required server and proxy settings.
  • Do not claim that a plugin can securely verify Premium ownership on an improperly configured offline-mode server.
  1. Cracked Account Authentication

For servers that intentionally allow cracked accounts, provide an optional authentication system for offline-mode accounts.

  • "/register <password> <confirmPassword>"
  • "/login <password>"
  • "/unregister <password>"
  • Store password hashes using BCrypt.
  • Bind offline-mode accounts to their UUID and registered IP address.
  • Never use IP address alone as proof of identity.
  • Reject a cracked player attempting to impersonate a protected Premium account.
  • Explain the limitations of offline-mode UUIDs and username impersonation.
  • Support a maximum of 3 registered accounts per IP address.
  • Enforce account limits using database records.
  • Allow administrators to reset account IP binding securely.

IMPORTANT: Premium account protection must be implemented through verified Minecraft authentication, not merely through a database of usernames.

  1. Registration and Login
  • Require password confirmation during registration.
  • Enforce configurable minimum and maximum password lengths.
  • Reject duplicate registrations.
  • Verify passwords securely.
  • Display configurable Sorani Kurdish messages.
  • Permit only configured authentication commands before login.
  • Prevent command aliases from bypassing restrictions.
  1. Authentication Spawn and Potion
  • Save the player's previous location before teleporting them to the authentication spawn.
  • Teleport unauthenticated players to the configured authentication spawn.
  • Apply the configured "TRIAL_OMEN" potion effect while unauthenticated.
  • Remove only the potion effect applied by this plugin after authentication.
  • Restore the previous location after successful login if enabled.
  • Add "/kksauthme setspawn" to configure the authentication spawn.
  • Validate the configured world and coordinates.
  1. Session System
  • Default session duration: 120 seconds.
  • Allow automatic login only when the saved session is valid and the UUID and IP match.
  • Verify that the account still exists.
  • Expired sessions must require password authentication.
  • Persist sessions safely if configured.
  • Never authenticate a player based only on their IP address.
  1. Failed Login Protection
  • Default maximum failed attempts: 3.
  • After 3 incorrect passwords, apply a 30-second cooldown.
  • Persist cooldowns across reconnects and server restarts.
  • Prevent reconnecting from bypassing the cooldown.
  • Reset failed attempts after successful login.
  • Display the remaining cooldown time.
  1. Login Timeout
  • Default timeout: 120 seconds.
  • Kick unauthenticated players after the timeout.
  • Cancel the timeout task after successful authentication or disconnect.
  • Do not apply authentication timeouts to verified Premium players.
  1. Restrictions Before Authentication

Configurable restrictions must include:

  • Movement
  • Chat
  • Block breaking and placement
  • Entity interactions
  • Inventory access
  • Item dropping and pickup
  • Attacking and receiving damage
  • Teleportation
  • Commands

Ensure the plugin does not block its own authentication commands or interfere with verified Premium players.

  1. Database
  • SQLite by default.
  • Optional MySQL support.
  • Use prepared statements.
  • Store UUID, username, password hash, registration date, IP binding, session information, and security cooldowns as required.
  • Never store plaintext passwords.
  • Never log passwords.
  • Avoid blocking the Minecraft main thread with database operations.
  • Handle database errors safely.
  1. Configuration

Generate a complete "config.yml" with these settings:

  • "max-accounts-per-ip: 3"
  • "login-timeout-seconds: 120"
  • "sessions-enabled: true"
  • "session-duration-seconds: 120"
  • "max-failed-attempts: 3"
  • "failed-login-cooldown-seconds: 30"
  • "persist-cooldowns: true"
  • "password-min-length: 6"
  • "password-max-length: 72"
  • "require-matching-uuid: true"
  • "require-matching-ip: true"
  • "prevent-movement-before-login: true"
  • "prevent-damage-before-login: true"
  • "restore-previous-location: true"
  • "teleport-to-auth-spawn: true"
  • Potion settings, including "TRIAL_OMEN"
  • Registration, login, and unregister settings
  • Configurable allowed commands
  • Configurable Sorani Kurdish messages
  • Configurable sounds
  • Admin and bypass permissions
  • SQLite and optional MySQL configuration
  • Premium authentication settings
  • Cracked-account authentication settings
  • Debug settings with password and IP logging disabled

Every configuration option must actually be implemented in the Java code. Do not include unused settings.

  1. Commands and Permissions

Commands:

  • "/register"
  • "/login"
  • "/unregister"
  • "/kksauthme reload"
  • "/kksauthme setspawn"
  • "/kksauthme info"
  • "/kksauthme accounts"

Permissions:

  • "kksauthme.admin"
  • "kksauthme.bypass"

Validate all command arguments and permissions.

  1. Deliverables

Provide the entire project:

  1. Project directory structure.
  2. Complete "pom.xml".
  3. Complete "plugin.yml".
  4. Complete "config.yml".
  5. All Java source files.
  6. Database initialization and migration code.
  7. All event listeners and command handlers.
  8. Build instructions using Maven.
  9. Instructions for uploading the JAR to MCServerHost.
  10. Testing instructions for Premium protection, cracked authentication, registration limits, sessions, cooldowns, and timeouts.

Before finishing:

  • Check compatibility with Paper 1.21.11 and Java 21.
  • Check every import and dependency.
  • Ensure every command and configuration setting is implemented.
  • Fix compilation errors.
  • Do not claim the plugin is tested unless it was actually compiled and tested.

If the project is too long for one response, provide it in numbered parts and continue until every file is included.

Kodari AI
KodariOct 19 at 5:42 pm 4
KKSAuthMe
A comprehensive Paper 1.21 authentication plugin securing servers with verified Premium account protection, BCrypt-hashed crack authentication, session management, failed login cooldowns, and configurable authentication spawn with movement restrictions and configurable Sorani Kurdish messages.
  1. Set up the Maven/Paper project and fail-closed premium-authentication checks.

  2. Implement SQLite/MySQL storage, BCrypt account flows, sessions, cooldowns, and account limits.

  3. Add commands, authentication restrictions, spawn/potion handling, and configurable Kurdish messages.

  4. Include configuration and deployment/testing guidance, with offline-mode limitations made explicit.

Created the KKSAuthMe Maven project with the requested Java sources, pom.xml, plugin.yml, config.yml, and dependency manifest.

Premium protection is fail-closed and direct-connection only. With the default settings, Paper must have online-mode=true; the plugin refuses to start otherwise. In online mode, Minecraft verifies each account before it joins, so verified players do not need /login or /register, and cracked clients cannot join by claiming their names.

Cracked-account authentication cannot safely provide that same Premium guarantee on an offline-mode server. To enable it, set premium.enabled: false, cracked-accounts.enabled: true, and online-mode=false. This mode uses BCrypt, UUID and IP bindings, and database-enforced account limits, but cannot prove Premium ownership or prevent Premium-name impersonation. Do not use it when Premium protection is required. This project does not trust proxy-forwarded identities; an offline-mode backend behind a proxy will not satisfy its Premium check.

Project structure

Plain Text
pom.xml
manifest.kod
src/main/resources/
  plugin.yml
  config.yml
src/main/java/com/kksauthme/
  KKSAuthMe.java
  command/AuthCommands.java
  database/AuthDatabase.java
  listener/AuthListener.java
  security/AuthManager.java
  util/MessageUtil.java

Compile and install: The project is Maven-configured for Java 21 and Paper 1.21.11. In Kodari, click Compile in the top bar, then click Compile in the window; download the resulting JAR. In MCServerHost, stop the server, upload the JAR into plugins/, and restart. Use Paper 1.21.11 and Java 21.

For Premium protection, set online-mode=true in server.properties, leave the default Premium settings enabled, and restart. For cracked-account testing, use an isolated test server and explicitly disable Premium protection as described above.

Test checklist: verify a Premium player joins without authentication commands; exercise register/login/unregister; try a fourth registration from the same IP; rejoin within and after the 120-second session; enter three incorrect passwords and check the cooldown survives a restart; wait for the login timeout; and test the pre-login restrictions. /kksauthme setspawn sets the authentication spawn, and /kksauthme resetip <username> clears an account’s IP binding for the next password-authenticated login.

I did not run a build or tests here, so I’m not claiming the project has been compiled or tested.

hama19aura

Bedrock Edition Support — Floodgate Integration

Add full support for Minecraft Bedrock players joining a Paper 1.21.11 server through Geyser and Floodgate.

Requirements:

  1. Detect Bedrock players securely using Floodgate's official API, not just their username or prefix.
  2. Bedrock players verified through Floodgate must bypass KKSAuthMe's "/login" and "/register" requirements.
  3. Do not apply the authentication potion, login timeout, or authentication restrictions to verified Bedrock players.
  4. Let verified Bedrock players join and play normally without creating a separate KKSAuthMe password.
  5. Continue requiring authentication for cracked Java players.
  6. Continue relying on official Minecraft authentication for Java Premium players.
  7. Never treat an ordinary Java player as a Bedrock player based on their username alone.
  8. Add a configurable setting:

bedrock: enabled: true floodgate-integration: true bypass-login: true bypass-registration: true bypass-login-timeout: true bypass-auth-restrictions: true

  1. Add the required Floodgate API dependency and configure it as a provided dependency where appropriate.
  2. If Floodgate is missing or disabled, handle it safely and explain the setup requirements.
  3. Ensure Java Premium players, cracked Java players, and authenticated Bedrock players are handled separately.
  4. Document how to install and configure Geyser and Floodgate on Paper 1.21.11.

IMPORTANT: Use Floodgate's verified player identity API to detect Bedrock players. Do not rely on username prefixes alone.

Kodari AI
KodariOct 19 at 6:32 pm 1

[Generation stopped]

hama19aura

Bedrock Edition Support — Floodgate Integration

Add full support for Minecraft Bedrock players joining a Paper 1.21.11 server through Geyser and Floodgate.

Requirements:

  1. Detect Bedrock players securely using Floodgate's official API, not just their username or prefix.
  2. Bedrock players verified through Floodgate must bypass KKSAuthMe's "/login" and "/register" requirements.
  3. Do not apply the authentication potion, login timeout, or authentication restrictions to verified Bedrock players.
  4. Let verified Bedrock players join and play normally without creating a separate KKSAuthMe password.
  5. Continue requiring authentication for cracked Java players.
  6. Continue relying on official Minecraft authentication for Java Premium players.
  7. Never treat an ordinary Java player as a Bedrock player based on their username alone.
  8. Add a configurable setting:

bedrock: enabled: true floodgate-integration: true bypass-login: true bypass-registration: true bypass-login-timeout: true bypass-auth-restrictions: true

  1. Add the required Floodgate API dependency and configure it as a provided dependency where appropriate.
  2. If Floodgate is missing or disabled, handle it safely and explain the setup requirements.
  3. Ensure Java Premium players, cracked Java players, and authenticated Bedrock players are handled separately.
  4. Document how to install and configure Geyser and Floodgate on Paper 1.21.11.

IMPORTANT: Use Floodgate's verified player identity API to detect Bedrock players. Do not rely on username prefixes alone.

Kodari AI
KodariOct 19 at 6:42 pm 2
  1. Add Floodgate identity detection using its API, with a safe no-Floodgate path and startup guidance.

  2. Apply the configurable Bedrock bypasses throughout join, timeout, potion, command, and restriction handling while keeping Java auth paths separate.

  3. Declare Floodgate as a provided/soft dependency, add the config defaults, and document Paper/Geyser/Floodgate setup.

Implemented Floodgate Bedrock support using Floodgate’s verified isFloodgatePlayer(UUID) API; names and prefixes are never used for detection. Verified Bedrock identities are cached for the session and kept separate from Java Premium players authenticated by Paper’s online mode.

The configured Bedrock bypasses now cover login, registration, timeout, and pre-auth restrictions. Verified Bedrock players also skip the authentication potion and auth-spawn teleport, and bypassed registration does not create a KKSAuthMe password.

Added the Floodgate API as a Maven provided dependency, declared Floodgate as a soft dependency, added the requested config defaults, and documented Paper 1.21.11 Geyser/Floodgate setup in BEDROCK_SETUP.md. If Floodgate is missing or its API is unavailable, KKSAuthMe logs a warning and grants no Floodgate-based bypass.

Kodari can make mistakes. Review important code before using.
Files
src
BEDROCK_SETUP.md
manifest.kod
pom.xml
Code
11 1,600
src/main/java/com/kksauthme/KKSAuthMe.java
package com.kksauthme;

import com.kksauthme.command.AuthCommands;
import com.kksauthme.database.AuthDatabase;
import com.kksauthme.listener.AuthListener;
import com.kksauthme.security.AuthManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public final class KKSAuthMe extends JavaPlugin {
    private AuthDatabase database;
    private AuthManager authManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        if (!validateSecurityMode()) {
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        if (getConfig().getBoolean("bedrock.enabled", true)
                && getConfig().getBoolean("bedrock.floodgate-integration", true)
                && !Bukkit.getPluginManager().isPluginEnabled("floodgate")) {
            getLogger().warning("Bedrock Floodgate integration is enabled, but Floodgate is not installed or enabled. Bedrock players will not be detected; install Geyser and Floodgate as described in BEDROCK_SETUP.md.");
        }

        if (getConfig().getBoolean("debug.log-passwords", false) || getConfig().getBoolean("debug.log-ips", false)) {
            getLogger().warning("Password/IP logging is not supported and will never be enabled.");
        }
        if (getConfig().getBoolean("cracked-accounts.enabled", false) && getServer().getOnlineMode()) {
            getLogger().warning("Cracked-account authentication is unavailable while online-mode=true; Mojang authentication remains mandatory.");
        }

        database = new AuthDatabase(this);
        authManager = new AuthManager(this, database);
        AuthCommands commands = new AuthCommands(this, authManager, database);
        Objects.requireNonNull(getCommand("register")).setExecutor(commands);
        Objects.requireNonNull(getCommand("login")).setExecutor(commands);
        Objects.requireNonNull(getCommand("unregister")).setExecutor(commands);
        Objects.requireNonNull(getCommand("kksauthme")).setExecutor(commands);
        Bukkit.getPluginManager().registerEvents(new AuthListener(this, authManager), this);

        database.ready().whenComplete((ignored, error) -> {
            if (error != null) {
                getLogger().severe("The authentication database could not be initialized. Check the configured database and restart.");
                Bukkit.getScheduler().runTask(this, () -> Bukkit.getPluginManager().disablePlugin(this));
            }
        });
        debug("Plugin enabled; authentication mode=" + (getServer().getOnlineMode() ? "online" : "offline"));
    }

    @Override
    public void onDisable() {
        if (authManager != null) {
            authManager.shutdown();
        }
        if (database != null) {
            database.close();
        }
    }

    public boolean validateSecurityMode() {
        boolean onlineMode = getServer().getOnlineMode();
        boolean premiumProtection = getConfig().getBoolean("premium.enabled", true);
        boolean requireOnlineMode = getConfig().getBoolean("premium.require-online-mode", true);
        boolean crackedEnabled = getConfig().getBoolean("cracked-accounts.enabled", false);

        if (premiumProtection && (!requireOnlineMode || !onlineMode)) {
            getLogger().severe("Premium protection requires premium.require-online-mode=true and Paper online-mode=true. Refusing to start in offline mode.");
            getLogger().severe("A username or offline UUID cannot prove Premium ownership. Do not expose an offline-mode backend as a substitute for verified authentication.");
            return false;
        }
        if (!onlineMode && !crackedEnabled) {
            getLogger().severe("This server is in offline mode but cracked-account authentication is disabled. Refusing to start without verified authentication.");
            return false;
        }
        return true;
    }

    public AuthManager getAuthManager() {
        return authManager;
    }

    public void debug(String message) {
        if (getConfig().getBoolean("debug.enabled", false)) {
            getLogger().info("[debug] " + message);
        }
    }
}