Alif Alif

Create a professional Minecraft Paper/Spigot plugin in Java (1.20+).

Plugin Name: AntiAltLogin

Main Purpose:

  • Prevent multiple logins using the same account
  • If a player is already online and someone tries to join with same account → block login
  • Show custom configurable message

Core Features:

  1. Use AsyncPlayerPreLoginEvent for login checking
  2. Detect already logged-in players using UUID and Bukkit API
  3. Deny login if player already online
  4. Show custom message from config.yml

Advanced Features:

  1. Config.yml:

- Custom kick message - Enable/disable plugin - Enable debug mode

  1. Permissions:

- antilogin.bypass → allows staff/admin to bypass restriction

  1. Logging:

- Log blocked login attempts in console - Show player name + IP

  1. Cooldown system:

- Prevent spam login attempts (e.g., 5 seconds delay)

  1. IP Protection:

- If same IP tries multiple login attempts, log it

  1. Fully async-safe & optimized

Extra Professional Features:

  1. Reload command:

- /antilogin reload

  1. Messages system (messages.yml support)
  2. Color codes support (&c, &a etc.)
  3. Clean OOP structure (separate classes)
  4. No memory leaks

Files Required:

  • Main plugin class
  • Listener class
  • Command class
  • config.yml
  • messages.yml
  • plugin.yml

Compatibility:

  • Paper / Spigot 1.20+
  • Should not conflict with AuthMe or other auth plugins

Output:

  • Full working Java code
  • Proper package structure
  • Comments for understanding
Kodari AI
KodariSep 20 at 6:03 am 2
AntiAltLogin
A professional Minecraft Paper/Spigot plugin that prevents multiple logins using the same account. Uses AsyncPlayerPreLoginEvent for async-safe login checking, detects already-online players via UUID, and denies duplicate logins with configurable kick messages. Features config.yml and messages.yml support with color codes, permission-based bypass for staff, console logging of blocked attempts with player name and IP, cooldown system to prevent spam login attempts, IP protection that logs multiple attempts from the same address, and a reload command. Clean OOP structure with separate main, listener, and command classes, fully async-safe and optimized with no memory leaks, compatible with Paper/Spigot 1.20+ and non-conflicting with AuthMe.
  1. Create the Gradle project and plugin metadata.

  2. Implement immutable runtime settings, message loading, online-player tracking, and async attempt tracking.

  3. Add the pre-login listener with UUID checks, bypass permission, cooldowns, IP logging, and join/quit lifecycle handling.

  4. Add /antilogin reload plus configurable config.yml and messages.yml.

Created the complete AntiAltLogin plugin project with:

  • Gradle Java 17 setup for Spigot/Paper 1.20+

  • AsyncPlayerPreLoginEvent duplicate UUID detection

  • Configurable enable/debug settings

  • messages.yml support with & color codes

  • Custom kick messages and %player% / %ip% placeholders

  • antilogin.bypass support

  • Blocked-login console logging with player, UUID, and IP

  • Per-UUID login cooldown tracking

  • Same-IP repeated-attempt detection

  • Thread-safe concurrent tracking and scheduled cleanup

  • /antilogin reload command

  • Join/quit online-player registry

  • Proper plugin metadata and permissions configuration

Alif Alif

Update to 26.2

Kodari AI
KodariSep 20 at 6:04 am 1
  • Update the Spigot API dependency to Minecraft 1.26.2.

  • Update the declared plugin API version to 1.26; no source changes are needed because the plugin uses stable Bukkit APIs.

Updated the plugin to Minecraft/Spigot 1.26.2:

  • build.gradle: spigot-api:1.26.2-R0.1-SNAPSHOT

  • plugin.yml: api-version: '1.26'

No Java source changes were required.

Alif Alif

Give download link

Kodari AI
KodariSep 20 at 6:06 am 1

I can’t host files or generate a public download URL directly from this chat.

To build the plugin locally:

Shell
./gradlew build

The compiled plugin will be available at:

Plain Text
build/libs/AntiAltLogin-1.0.0.jar

Copy that .jar into your server’s plugins/ folder and restart the server.

Alif Alif

.jar files dooo

Kodari AI
KodariSep 20 at 6:06 am 1

I can provide the complete source project, but I can’t directly generate or attach a downloadable .jar file from this chat.

Build it with:

Shell
./gradlew build

The resulting file will be:

Plain Text
build/libs/AntiAltLogin-1.0.0.jar

If Gradle isn’t installed, use:

Shell
gradle build

Then place the JAR in your server’s plugins/ folder.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
12 532
src/main/java/com/kodari/antilogin/AntiAltLoginPlugin.java
package com.kodari.antilogin;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class AntiAltLoginPlugin extends JavaPlugin {
    private volatile PluginSettings settings;
    private MessageManager messageManager;
    private OnlinePlayerRegistry onlinePlayerRegistry;
    private LoginAttemptTracker loginAttemptTracker;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);

        this.settings = PluginSettings.from(getConfig());
        this.messageManager = new MessageManager(this);
        this.onlinePlayerRegistry = new OnlinePlayerRegistry();
        this.loginAttemptTracker = new LoginAttemptTracker(this, settings);

        for (Player player : Bukkit.getOnlinePlayers()) {
            onlinePlayerRegistry.register(player);
        }

        Bukkit.getPluginManager().registerEvents(new LoginListener(this), this);
        AntiLoginCommand command = new AntiLoginCommand(this);
        if (getCommand("antilogin") != null) {
            getCommand("antilogin").setExecutor(command);
            getCommand("antilogin").setTabCompleter(command);
        }

        if (settings.debug()) {
            getLogger().info("AntiAltLogin enabled in debug mode.");
        }
    }

    @Override
    public void onDisable() {
        if (loginAttemptTracker != null) {
            loginAttemptTracker.close();
        }
        if (onlinePlayerRegistry != null) {
            onlinePlayerRegistry.clear();
        }
    }

    public void reloadPlugin() {
        reloadConfig();
        this.settings = PluginSettings.from(getConfig());
        this.messageManager.reload();
        this.loginAttemptTracker.updateSettings(settings);
    }

    public PluginSettings settings() {
        return settings;
    }

    public MessageManager messages() {
        return messageManager;
    }

    public OnlinePlayerRegistry onlinePlayers() {
        return onlinePlayerRegistry;
    }

    public LoginAttemptTracker attempts() {
        return loginAttemptTracker;
    }
}