Sk gamer

Create a Minecraft authentication/login plugin for Minecraft version 1.21.11. When a player joins the server, they should spawn in a secure void world or void area where they cannot move around the main server. After successfully logging in or registering, the player should automatically be teleported to the main server world and allowed to play normally. Before authentication, players must not be able to access the main world or interact with other players. Ensure the plugin is secure, lightweight, and compatible with Minecraft 1.21.11.

Kodari AI
KodariOct 22 at 10:30 am 1
AuthVoidGate
Secure authentication plugin for Minecraft 1.21.11. Unauthenticated players spawn in an isolated void world, unable to move, interact, or access the main server. On successful login or registration, players are automatically teleported to the main world with full gameplay access. Features encrypted password hashing, session management, brute-force protection, and lightweight event-driven architecture. Prevents unauthorized world access, player interaction, and data exploitation before verification. Seamless integration with Spigot/Paper API, configurable void world dimensions, and automatic teleportation logic ensures a smooth, secure player experience.
  1. Add the Paper 1.21.11 project setup and a dedicated void authentication world.

  2. Add /register and /login with asynchronous PBKDF2 password hashing and persistent credentials.

  3. Lock unauthenticated players out of movement, commands, chat, inventories, and interactions; release them to the main world after authentication.

Created SecureAuth for Paper 1.21.11. Players enter a dedicated void authentication world and must use /register <password> <confirm-password> or /login <password> before teleporting to the main world.

Passwords are stored as salted PBKDF2 hashes. While unauthenticated, players are restricted from movement, chat, other commands, damage, inventory actions, and interactions. Configure auth-world and main-world in config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 655
src/main/java/com/kodari/secureauth/SecureAuthPlugin.java
package com.kodari.secureauth;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.plugin.java.JavaPlugin;

public final class SecureAuthPlugin extends JavaPlugin {
    private World authenticationWorld;
    private World mainWorld;
    private AuthManager authManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        String authWorldName = getConfig().getString("auth-world", "kodari_auth");
        authenticationWorld = Bukkit.getWorld(authWorldName);
        if (authenticationWorld == null) {
            authenticationWorld = Bukkit.createWorld(new WorldCreator(authWorldName).generator(new VoidChunkGenerator()));
        }
        if (authenticationWorld == null) {
            getLogger().severe("Could not create or load the authentication world.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        authenticationWorld.setSpawnLocation(0, 100, 0);

        mainWorld = Bukkit.getWorld(getConfig().getString("main-world", "world"));
        if (mainWorld == null || mainWorld.equals(authenticationWorld)) {
            mainWorld = Bukkit.getWorlds().stream()
                    .filter(world -> !world.equals(authenticationWorld))
                    .findFirst()
                    .orElse(null);
        }
        if (mainWorld == null) {
            getLogger().severe("No main world is available; configure main-world in config.yml.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        authManager = new AuthManager(this);
        getServer().getPluginManager().registerEvents(new AuthListener(this, authManager), this);
        getCommand("register").setExecutor(new AuthCommand(authManager));
        getCommand("login").setExecutor(new AuthCommand(authManager));
    }

    public World getAuthenticationWorld() {
        return authenticationWorld;
    }

    public World getMainWorld() {
        return mainWorld;
    }
}