dcb_herobrine

Make a login and register plugin. Like limboauth and limbo api. In limbo auth we see if player join then he loginvor register in void that good thing also make it more security like player can't do anything like they can't chat,command,see they just login and register can do also player get darkness

Kodari AI
KodariAug 16 at 8:45 pm 2
LimboAuthSecurity
Implements a secure login and registration system for Minecraft Fabric servers. When a player joins, they are placed in a void-like limbo state where they cannot chat, execute commands, or interact with the world. Players must authenticate through a registration or login process before gaining full access. The system applies a darkness effect to visually indicate the restricted state, enhancing security by preventing unauthorized actions until proper verification is completed.

I’ll build a Fabric 1.21.11 login/register mod with isolated limbo handling, secure movement/action lockout, darkness, and /login//register commands.

Created a complete Fabric 1.21.11 LimboAuth mod from scratch.

  • Added /register <password> and /login <password>.

  • Stores salted PBKDF2-HMAC-SHA256 password hashes in the server world.

  • Sends unauthenticated players to a protected End void limbo.

  • Applies darkness while unauthenticated.

  • Blocks chat, interactions, block breaking, attacks, item use, item drops, inventory clicks, damage, movement, and non-auth commands.

  • Restores the player’s original dimension and position after successful authentication.

  • Adds five-attempt protection and login rate limiting.

  • Added Fabric Loom build configuration, mod metadata, mixin configuration, and English translations.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
10 570
src/main/java/com/kodari/limboauth/LimboAuth.java
package com.kodari.limboauth;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.player.AttackBlockCallback;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import net.fabricmc.fabric.api.event.player.PlayerDropItemCallback;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
import net.fabricmc.fabric.api.event.player.UseItemCallback;
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.minecraft.util.ActionResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class LimboAuth implements ModInitializer {
    public static final String MOD_ID = "limboauth";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
    public static final AuthManager AUTH = new AuthManager();

    @Override
    public void onInitialize() {
        AuthCommands.register();

        ServerLifecycleEvents.SERVER_STARTED.register(AUTH::start);
        ServerLifecycleEvents.SERVER_STOPPING.register(AUTH::stop);
        ServerTickEvents.END_SERVER_TICK.register(AUTH::tick);

        ServerPlayConnectionEvents.JOIN.register((handler, sender, server) ->
            AUTH.handleJoin(handler.getPlayer()));
        ServerPlayConnectionEvents.DISCONNECT.register((handler, server) ->
            AUTH.handleDisconnect(handler.getPlayer()));

        ServerMessageEvents.ALLOW_CHAT_MESSAGE.register((message, sender, params) ->
            !AUTH.isLocked(sender));

        UseBlockCallback.EVENT.register((player, world, hand, hit) -> blocked(player));
        UseEntityCallback.EVENT.register((player, world, hand, entity, hit) -> blocked(player));
        UseItemCallback.EVENT.register((player, world, hand) -> blocked(player));
        AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> blocked(player));
        AttackEntityCallback.EVENT.register((player, world, hand, entity, hit) -> blocked(player));
        PlayerDropItemCallback.EVENT.register((player, stack) -> blocked(player));
        PlayerBlockBreakEvents.BEFORE.register((world, player, pos, state, blockEntity) ->
            !AUTH.isLocked(player));
        ServerLivingEntityEvents.ALLOW_DAMAGE.register((entity, source, amount) ->
            !(entity instanceof net.minecraft.server.network.ServerPlayerEntity player && AUTH.isLocked(player)));
    }

    private static ActionResult blocked(net.minecraft.entity.player.PlayerEntity player) {
        return AUTH.isLocked(player) ? ActionResult.FAIL : ActionResult.PASS;
    }
}