newgamerisback

Develop a Minecraft plugin named AstralLogin for version 1.21.11 that enforces a secure login system. Upon joining, players must register using /register <password> <repeat password>; if already registered, they can log in with /login. Implement features to prevent unauthorized access, ensuring players cannot interact or use commands until they are logged in, effectively blocking access to coordinates and sensitive data. Include configuration options for password complexity and a cooldown for login attempts. hide the inventory of player also until logged in author - _unknown_jai

Kodari AI
KodariMar 8 at 3:31 am 20,605 (v2)

I’ll create a comprehensive authentication plugin with full security features.

AstralLogin
A secure authentication system for Minecraft servers that enforces player login requirements. Players must register with password validation and log in before accessing server features. Includes protection against unauthorized access by blocking movement, interactions, inventory access, and commands until authenticated. Features configurable password complexity rules, login attempt cooldowns, and secure password hashing with salt.

I’ll create a secure authentication plugin with complete protection until login.

All files created successfully. AstralLogin is now complete with secure authentication, password hashing with salt, comprehensive player protection (movement, commands, inventory, interactions all blocked until login), configurable password complexity rules, login attempt cooldowns, and automatic timeout kicks.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
13 762
src/main/java/com/unknownjai/astrallogin/AstralLogin.java
package com.unknownjai.astrallogin;

import com.unknownjai.astrallogin.command.AstralLoginCommand;
import com.unknownjai.astrallogin.command.LoginCommand;
import com.unknownjai.astrallogin.command.RegisterCommand;
import com.unknownjai.astrallogin.listener.JoinQuitListener;
import com.unknownjai.astrallogin.listener.PlayerProtectionListener;
import com.unknownjai.astrallogin.manager.ConfigManager;
import com.unknownjai.astrallogin.manager.DataManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AstralLogin extends JavaPlugin {
    private ConfigManager configManager;
    private DataManager dataManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.dataManager = new DataManager(this);
        
        getCommand("register").setExecutor(new RegisterCommand(this));
        getCommand("login").setExecutor(new LoginCommand(this));
        getCommand("astrallogin").setExecutor(new AstralLoginCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new JoinQuitListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerProtectionListener(this), this);
        
        getLogger().info("AstralLogin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (dataManager != null) {
            dataManager.saveData();
        }
        getLogger().info("AstralLogin has been disabled!");
    }
}