notrywo

I want a plugin that a login/register plugins that stores data means the pass user add it saves to plugin files + a spawn system also that which place is spawn place for register and logined player for no greifing

Kodari AI
KodariFeb 7 at 5:47 am 9,102 (v2)

I’ll create a secure login/register plugin with spawn protection to prevent griefing before authentication.

SecureLogin
A comprehensive authentication plugin with login and register systems that stores encrypted player passwords in local files. Features a spawn protection system that teleports unauthenticated players to a safe spawn location and restricts all actions until they log in. Prevents griefing by blocking movement, building, breaking, and interactions for unregistered or logged-out players. Includes password hashing for security and persistent session management.

Plugin created successfully! SecureLogin is a comprehensive authentication system with:

Features:

  • Player registration with password confirmation

  • Secure login system with BCrypt password hashing

  • Passwords stored in plugins/SecureLogin/playerdata/{uuid}.yml

  • Configurable spawn point for unauthenticated players

  • Complete action blocking until authenticated

Commands:

  • /register <password> <confirm> - Create account

  • /login <password> - Login to account

  • /logout - Logout and return to spawn

  • /setspawn - Set authentication spawn (requires op)

Protection System: Players cannot perform ANY actions until logged in:

  • Frozen at spawn location (no movement)

  • Cannot break/place blocks

  • Cannot interact with anything

  • Cannot use inventory or drop items

  • Cannot chat or use commands (except /login and /register)

  • Cannot take or deal damage

Setup Instructions:

  1. Start server to generate config

  2. Set spawn location with /setspawn at your desired safe zone

  3. Players will be teleported there on join and restricted until authenticated

Passwords are securely hashed with BCrypt and stored locally in plugin files!

notrywo

How can I access passwords?

Kodari AI
KodariFeb 7 at 5:48 am 4,566 (v2)

I’ll help you understand how passwords are accessed in this SecureLogin plugin. Let me read the relevant files to see how password storage and access is implemented.

Password Access in SecureLogin

Based on the code, here’s how passwords are handled in this plugin:

Password Storage

Passwords are BCrypt hashed and stored in YAML files at:

Plain Text
plugins/SecureLogin/playerdata/<UUID>.yml

Each file contains:

  • password - BCrypt hash (not plaintext)

  • registered-at - timestamp

  • last-login - timestamp

Accessing Passwords (Verification Only)

You cannot retrieve plaintext passwords because they’re securely hashed with BCrypt. However, you can verify them:

Java
// Get the PlayerDataManager instance
PlayerDataManager dataManager = plugin.getPlayerDataManager();

// Check if a player is registered
boolean isRegistered = dataManager.isRegistered(uuid);

// Verify a password (returns true/false)
boolean isCorrect = dataManager.verifyPassword(uuid, passwordAttempt);

Authentication Flow

  1. Registration → AuthManager.register() → stores BCrypt hash via PlayerDataManager.registerPlayer()

  2. Login → AuthManager.login() → verifies password via PlayerDataManager.verifyPassword()

  3. Session → AuthManager tracks authenticated players in memory

Important Security Notes

  • Passwords are one-way hashed with BCrypt (cannot be decrypted)

  • To verify a password, you must use verifyPassword(uuid, password)

  • Never store or log plaintext passwords

  • The BCrypt salt is automatically generated during registration

If you need to implement password-related features, always go through PlayerDataManager.verifyPassword() rather than trying to access the hash directly.

notrywo

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^

ERROR in   src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
  import org.mindrot.jbcrypt.BCrypt;
                            ^

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/securelogin/managers/PlayerDataManager.java
  -   src/main/java/com/securelogin/managers/PlayerDataManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

notrywo

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^

ERROR in   src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
  import org.mindrot.jbcrypt.BCrypt;
                            ^

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/securelogin/managers/PlayerDataManager.java
  -   src/main/java/com/securelogin/managers/PlayerDataManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariFeb 9 at 5:47 pm 3,671 (v2)

I need to read the files to understand the dependency issue and fix it.

The BCrypt dependency is declared in build.gradle but not properly configured in manifest.kod. I need to fix the manifest.kod format to include the full library coordinates.

notrywo

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^

ERROR in   src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
  import org.mindrot.jbcrypt.BCrypt;
                            ^

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/securelogin/managers/PlayerDataManager.java
  -   src/main/java/com/securelogin/managers/PlayerDataManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariFeb 9 at 5:48 pm 1,415 (v2)

I need to read the dependency configuration files and the PlayerDataManager to understand the BCrypt usage.

The issue is that the manifest.kod format is incorrect. It should use just the library name, not the full Maven coordinates.

notrywo

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^

ERROR in   src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
  import org.mindrot.jbcrypt.BCrypt;
                            ^

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 5: package org.mindrot.jbcrypt does not exist
import org.mindrot.jbcrypt.BCrypt;
                          ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/securelogin/managers/PlayerDataManager.java
  -   src/main/java/com/securelogin/managers/PlayerDataManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariFeb 9 at 5:50 pm 5,026 (v2)

I’ll fix the BCrypt dependency issue. Let me first read the relevant files to understand the current setup.

I see the issue - the BCrypt library isn’t being found. Let me switch to a more modern and well-maintained BCrypt library and update the code accordingly.

Analysis:

  • Old org.mindrot:jbcrypt:0.4 is outdated (last updated 2014)

  • Switching to at.favre.lib:bcrypt:0.10.2 (actively maintained, compatible)

  • Need to update build.gradle, manifest.kod, and PlayerDataManager.java

Fixed: Switched to modern at.favre.lib:bcrypt library with updated API calls in PlayerDataManager.

notrywo

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 3: package at.favre.lib.crypto.bcrypt does not exist
import at.favre.lib.crypto.bcrypt.BCrypt;
                                 ^

ERROR in   src/main/java/com/securelogin/managers/PlayerDataManager.java at line 3: package at.favre.lib.crypto.bcrypt does not exist
  import at.favre.lib.crypto.bcrypt.BCrypt;
                                   ^

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 3: package at.favre.lib.crypto.bcrypt does not exist
import at.favre.lib.crypto.bcrypt.BCrypt;
                                 ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/securelogin/managers/PlayerDataManager.java
  -   src/main/java/com/securelogin/managers/PlayerDataManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

notrywo

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 3: package at.favre.lib.crypto.bcrypt does not exist
import at.favre.lib.crypto.bcrypt.BCrypt;
                                 ^

ERROR in   src/main/java/com/securelogin/managers/PlayerDataManager.java at line 3: package at.favre.lib.crypto.bcrypt does not exist
  import at.favre.lib.crypto.bcrypt.BCrypt;
                                   ^

ERROR in src/main/java/com/securelogin/managers/PlayerDataManager.java at line 3: package at.favre.lib.crypto.bcrypt does not exist
import at.favre.lib.crypto.bcrypt.BCrypt;
                                 ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/securelogin/managers/PlayerDataManager.java
  -   src/main/java/com/securelogin/managers/PlayerDataManager.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariFeb 12 at 4:58 pm 7,817 (v2)

I need to check the current build configuration and how BCrypt is being used.

The issue is that the bcrypt library isn’t being recognized in the manifest.kod. I’ll replace BCrypt with Java’s built-in PBKDF2 password hashing, which is secure and requires no external dependencies.

Replaced BCrypt with Java’s built-in PBKDF2WithHmacSHA256 password hashing. This is cryptographically secure, uses proper salting, and requires no external dependencies.

notrywo

what more can we do in this plugin?

Kodari AI
KodariFeb 13 at 5:33 pm 8,311 (v2)

I’ll analyze the current plugin implementation to suggest meaningful enhancements.

Based on my analysis of your SecureLogin plugin, here are meaningful enhancements you can add:

🔒 Security & Protection Enhancements

  1. Session Timeout - Auto-logout after inactivity (config has session-timeout: 300 but it’s not implemented)

  2. Login Attempts Limit - Lock accounts after X failed attempts to prevent brute force

  3. IP-Based Auto-Login - Remember trusted IPs for auto-authentication

  4. Blind Effect During Login - Apply blindness/slowness until authenticated for better security

  5. Password Change Command - Let players change their passwords (/changepassword <old> <new>)

  6. Admin Password Reset - Admins can reset player passwords (/securelogin resetpassword <player>)

🎨 User Experience

  1. Login GUI - Clickable GUI for login/register instead of chat commands

  2. Boss Bar/Action Bar Timer - Show countdown “Login in X seconds or be kicked”

  3. Login Reminder - Repeated messages reminding player to login

  4. Auto-Kick on Timeout - Kick players who don’t login within X seconds

  5. Title Screen Messages - Display login instructions as titles/subtitles

  6. Login Streak Tracking - Track daily login streaks with rewards

  7. Hide From Tab List - Hide unauthenticated players from tab list

⚙️ Admin & Management

  1. Reload Command - /securelogin reload to reload config without restart

  2. Unregister Command - /securelogin unregister <player> to remove accounts

  3. Player Info Command - /securelogin info <player> - shows registration date, last login

  4. Force Login/Logout - Admin commands to manage sessions

  5. Database Support - MySQL/SQLite option for better performance with many players

  6. Login Statistics - Track total logins, failed attempts, etc.

🔗 Integration & Advanced

  1. PlaceholderAPI Support - %securelogin_status%, %securelogin_last_login%

  2. Email Verification - Optional email verification on registration

  3. 2FA System - Two-factor authentication with codes

  4. Discord Linking - Link Minecraft accounts to Discord

  5. Migration Tool - Import from other auth plugins (AuthMe, etc.)

  6. BCrypt Alternative - Option for BCrypt instead of PBKDF2

  7. Per-World Spawns - Different login spawns per world

  8. Captcha System - Anti-bot captcha on registration

🎯 Most Impactful Additions (Recommended Priority)

Would you like me to implement any of these? I’d recommend starting with:

  • Session timeout with kick (most requested security feature)

  • Login attempts limit (prevents attacks)

  • Boss bar timer (greatly improves UX)

  • Admin management commands (essential for server management)

  • PlaceholderAPI support (high value, easy integration)

Which feature(s) would you like me to add?

notrywo

ok iwant 3,4,6

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
13 696
src/main/java/com/securelogin/SecureLogin.java
package com.securelogin;

import com.securelogin.commands.LoginCommand;
import com.securelogin.commands.LogoutCommand;
import com.securelogin.commands.RegisterCommand;
import com.securelogin.commands.SetSpawnCommand;
import com.securelogin.listeners.PlayerProtectionListener;
import com.securelogin.managers.AuthManager;
import com.securelogin.managers.PlayerDataManager;
import com.securelogin.managers.SpawnManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SecureLogin extends JavaPlugin {
    private PlayerDataManager playerDataManager;
    private AuthManager authManager;
    private SpawnManager spawnManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.playerDataManager = new PlayerDataManager(this);
        this.authManager = new AuthManager(this);
        this.spawnManager = new SpawnManager(this);

        getCommand("register").setExecutor(new RegisterCommand(this));
        getCommand("login").setExecutor(new LoginCommand(this));
        getCommand("setspawn").setExecutor(new SetSpawnCommand(this));
        getCommand("logout").setExecutor(new LogoutCommand(this));

        getServer().getPluginManager().registerEvents(new PlayerProtectionListener(this), this);

        getLogger().info("SecureLogin has been enabled!");
    }

    @Override
    public void onDisable() {
        if (authManager != null) {
            authManager.clearSessions();
        }
        getLogger().info("SecureLogin has been disabled!");
    }

    public String getMessage(String key) {
        String prefix = getConfig().getString("messages.prefix", "&8[&cSecureLogin&8]&r ");
        String message = getConfig().getString("messages." + key, "&cMessage not found: " + key);
        return colorize(prefix + message);
    }

    public String colorize(String text) {
        return text.replace("&", "§");
    }
}