P

DEMONAUTH

Create a premium Minecraft authentication plugin called DemonAuth for Paper, Spigot and Purpur.

MAIN GOAL:

Build a modern authentication plugin better than AuthMe, supporting Java, Bedrock, Pocket Edition, GeyserMC and Floodgate.

IMPORTANT DESIGN REFERENCES:

Use the provided screenshots as visual references.

Reference 1:

  • Large center-screen login/register text.
  • Custom title/subtitle system.
  • Animated authentication messages.

Reference 2:

  • BossBar countdown timer showing remaining authorization time.
  • Fully customizable colors, style and progress.

Reference 3:

  • Large welcome message after login.
  • Configurable login success animations.
  • Hologram/title style greeting.

Reference 4:

  • Frozen player authentication mode where player sees own skin while waiting to login.
  • Configurable camera modes.

Reference 5:

  • Make database like shown in image

DATABASE SYSTEM:

Support:

  • SQLite
  • MySQL
  • MariaDB

Passwords MUST be hashed using:

  • Argon2 (preferred)
  • BCrypt fallback

Never store plain passwords.

MIGRATION SYSTEM:

DO NOT use migration commands.

Instead:

Create a folder:

plugins/DemonAuth/migration/

Server owner can place:

  • playerdata.db
  • auth.db
  • users.db
  • imported files

inside migration folder.

On startup DemonAuth should detect migration files automatically and import data.

Config example:

migration: enabled: true auto-detect: true backup-before-import: true

The migration framework must be extendable.

AUTH FEATURES:

Register: /register <password> <repeat-password>

Login: /login <password>

Premium minecraft account users:

  • Register once
  • No future login required

Support:

  • Premium Java
  • Premium Bedrock
  • Floodgate Players
  • cracked java

SESSION SYSTEM:

Configurable:

session: enabled: true hours: 24

Ability to see:

  • Session status
  • Last login
  • Time remaining

LOGIN PROTECTION:

Configurable:

  • Freeze movement
  • Blindness
  • Slowness
  • Disable inventory
  • Disable commands
  • Disable chat
  • Disable damage
  • Disable interaction
  • Disable item drops
  • Disable pickups

Multiple freeze modes:

  1. Full freeze
  2. Limited radius
  3. Spectator camera
  4. Skin-view mode

LOCATIONS:

Configurable:

  • Login Location
  • Register Location
  • Hub Spawn
  • Previous Location
  • World Spawn

After login:

Option A:

Teleport hub.

Option B:

Return previous location.

Option C:

Custom location.

TITLE SYSTEM:

Fully configurable:

  • Join Title
  • Register Title
  • Login Title
  • Success Title
  • Failure Title

ACTIONBAR SYSTEM:

Show:

  • Login reminders
  • Register reminders
  • Session reminders

BOSSBAR SYSTEM:

Like screenshot.

Show:

"Remaining authorization time: 79s"

Configurable:

  • Color
  • Style
  • Progress
  • Animation

WELCOME SYSTEM:

After login display:

Large center-screen welcome animation.

Example:

Hi PlayerName Logged In Successfully

Configurable:

  • Text
  • Colors
  • Sounds
  • Particles
  • Duration

EMAIL SYSTEM:

Commands:

/email set <email> /email verify <otp> /email remove

OTP verification required.

SMTP support:

  • Gmail
  • Outlook
  • Custom SMTP

Configurable sender.

PASSWORD RECOVERY:

/forgotpassword

Process:

  1. Send OTP
  2. Verify OTP
  3. Reset password

2FA SYSTEM:

Implement Google Authenticator compatible TOTP.

Commands:

/2fa enable /2fa disable /2fa verify

Features:

  • QR Code generation
  • Recovery codes
  • Backup codes
  • Email fallback

ADMINS MUST NEVER SEE PASSWORDS.

Admin commands:

/dauth reload /dauth resetpassword <player> /dauth deletepassword <player> /dauth unregister <player> /dauth force-login <player> /dauth info <player>

INFO COMMAND:

Display:

  • UUID
  • Registration Date
  • Last Login
  • Premium Status
  • Bedrock Status
  • Floodgate Status
  • Email Linked
  • 2FA Enabled
  • Session Status

SECURITY:

  • Anti Bot
  • Anti Brute Force
  • Login Rate Limit
  • Async Database
  • Secure OTP
  • Secure Hashing
  • IP Protection

MESSAGES:

All messages configurable in messages.yml

Support:

  • MiniMessage
  • RGB Colors
  • HEX Colors

FILES:

config.yml messages.yml database.yml email.yml protection.yml

PERFORMANCE:

Must handle large SMP and Network servers efficiently.

BEDROCK SUPPORT:

Fully support:

  • Bedrock
  • Pocket Edition Android
  • Pocket Edition iOS
  • Consoles
  • GeyserMC
  • Floodgate

Premium Bedrock players should not be forced to login repeatedly.

FINAL REQUIREMENT:

Plugin should be production-ready, optimized, secure, fully configurable, easy to migrate to, and use the provided screenshots as design/UI references.

5 images attached
Kodari AI
KodariJun 4 at 7:31 am 80
DemonAuth
A premium Minecraft authentication plugin supporting Java, Bedrock, and Floodgate/GeyserMC players. Features Argon2/BCrypt password hashing, SQLite/MySQL/MariaDB databases, auto-migration from AuthMe, session management, anti-brute-force security, 2FA with TOTP, email OTP verification, password recovery, animated title/bossbar/welcome UI, freeze modes including skin-view camera, and fully configurable MiniMessage messages.

Plan:

  1. Build files + resources (plugin.yml, config files)

  2. Model + Database layer (PlayerData, Database interface, SQLite/MySQL impls)

  3. Auth core (PasswordUtil, SessionManager, PremiumChecker, AuthManager)

  4. UI system (TitleManager, BossBarManager, WelcomeManager)

  5. Protection + Location managers

  6. Email/OTP + 2FA

  7. Security + Migration

  8. Commands + Listeners

  9. Main plugin class

Here’s a summary of what was built:

39 files across the full plugin:

  • Database layer — Abstract JDBC base with upsert SQL, SQLiteDatabase (HikariCP + WAL mode), MySQLDatabase (full ON DUPLICATE KEY UPDATE), async cache via DatabaseManager

  • Auth core — PasswordUtil using Bouncy Castle Argon2id (PHC string format) with BCrypt fallback + format auto-detection on verify; SessionManager with IP binding; AuthManager handling the full register → login → 2FA state machine; async password hashing so the main thread never blocks

  • UI system — BossBarManager with live per-second countdown tasks matching screenshot 4’s bossbar style; TitleManager with Adventure API titles + repeating actionbar reminders; WelcomeManager showing the “Hi PlayerName / Logged In Successfully” animation from screenshots 2 & 3 with sound + particles

  • Protection — 4 freeze modes: FULL_FREEZE (cancel movement), LIMITED_RADIUS, SPECTATOR_CAMERA, SKIN_VIEW (spawn invisible ArmorStand in front of player → setSpectatorTarget for the skin view camera effect from screenshot 5); all restrictions (inventory, chat, commands, damage, drops, pickups) are configurable

  • Floodgate/Bedrock — Soft-depends floodgate; falls back to prefix check if not installed; premium check via Mojang API async with auto-login

  • TOTP — RFC 6238 TOTP implemented manually using HmacSHA1 + custom Base32, no extra deps; QR code as clickable Adventure link; 8 backup codes stored as CSV

  • Email — JavaMail SMTP with OTPManager for in-memory time-limited OTPs; email verify + password recovery flows

  • Migration — Auto-detects AuthMe SQLite (authme table) and previous DemonAuth DBs in plugins/DemonAuth/migration/ on startup with backup-before-import

  • Security — Per-IP failed attempt tracking, auto-lockout after 20 failures, 5-minute cooldown, async cleanup task

  • 5 config files — config.yml, messages.yml (full MiniMessage), database.yml, email.yml, protection.yml

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
41 3,408
src/main/java/com/demonauth/DemonAuth.java
package com.demonauth;

import com.demonauth.auth.AuthManager;
import com.demonauth.auth.PremiumChecker;
import com.demonauth.auth.SessionManager;
import com.demonauth.command.*;
import com.demonauth.config.ConfigManager;
import com.demonauth.database.DatabaseManager;
import com.demonauth.email.EmailManager;
import com.demonauth.email.OTPManager;
import com.demonauth.listener.AuthListener;
import com.demonauth.listener.ProtectionListener;
import com.demonauth.location.LocationManager;
import com.demonauth.migration.MigrationManager;
import com.demonauth.protection.ProtectionManager;
import com.demonauth.security.SecurityManager;
import com.demonauth.totp.TwoFactorManager;
import com.demonauth.ui.BossBarManager;
import com.demonauth.ui.TitleManager;
import com.demonauth.ui.WelcomeManager;
import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

public class DemonAuth extends JavaPlugin {

    @Getter private static DemonAuth instance;

    @Getter private ConfigManager configManager;
    @Getter private DatabaseManager databaseManager;
    @Getter private SessionManager sessionManager;
    @Getter private SecurityManager securityManager;
    @Getter private PremiumChecker premiumChecker;
    @Getter private ProtectionManager protectionManager;
    @Getter private LocationManager locationManager;
    @Getter private TitleManager titleManager;
    @Getter private BossBarManager bossBarManager;
    @Getter private WelcomeManager welcomeManager;
    @Getter private EmailManager emailManager;
    @Getter private OTPManager otpManager;
    @Getter private TwoFactorManager twoFactorManager;
    @Getter private AuthManager authManager;
    @Getter private MigrationManager migrationManager;

    @Override
    public void onEnable() {
        instance = this;
        getDataFolder().mkdirs();

        configManager = new ConfigManager(this);
        databaseManager = new DatabaseManager(this);
        databaseManager.initialize();

        sessionManager = new SessionManager(this);
        securityManager = new SecurityManager(this);
        premiumChecker = new PremiumChecker(this);
        protectionManager = new ProtectionManager(this);
        locationManager = new LocationManager(this);
        titleManager = new TitleManager(this);
        bossBarManager = new BossBarManager(this);
        welcomeManager = new WelcomeManager(this);
        emailManager = new EmailManager(this);
        otpManager = new OTPManager();
        twoFactorManager = new TwoFactorManager(this);
        authManager = new AuthManager(this);
        migrationManager = new MigrationManager(this);

        migrationManager.runMigrations();

        registerCommands();
        getServer().getPluginManager().registerEvents(new AuthListener(this), this);
        getServer().getPluginManager().registerEvents(new ProtectionListener(this), this);

        getLogger().info("DemonAuth v" + getDescription().getVersion() + " enabled!");
    }

    @Override
    public void onDisable() {
        if (bossBarManager != null) bossBarManager.removeAll();
        if (protectionManager != null) protectionManager.restoreAll();
        if (databaseManager != null) databaseManager.close();
        getLogger().info("DemonAuth disabled.");
    }

    private void registerCommands() {
        getCommand("login").setExecutor(new LoginCommand(this));
        getCommand("register").setExecutor(new RegisterCommand(this));
        getCommand("email").setExecutor(new EmailCommand(this));
        getCommand("2fa").setExecutor(new TwoFACommand(this));
        getCommand("forgotpassword").setExecutor(new ForgotPasswordCommand(this));
        getCommand("dauth").setExecutor(new DAuthCommand(this));
    }

    public FileConfiguration getDatabaseConfig() {
        return configManager.getDatabaseConfig();
    }

    public FileConfiguration getEmailConfig() {
        return configManager.getEmailConfig();
    }
}