S

Fix the issue where the plugin places a single bedrock in block under the player. This should be completely removed so no block is placed at the player’s location.(voidspawn)

In the void spawn system, instead of placing blocks, just enable the flight for the player and keep them fixed at coordinates (0, 0, 0). The player must remain suspended in place without falling.

While the player is not authenticated, hide their entire inventory and prevent access to all items. Ensure the player cannot switch between hotbar slots. These restrictions must apply both in void spawn and non-void spawn, situations until authentication is complete.

Ensure the player takes no damage at all while in void spawn or until authenticated, including void damage and any other type of damage.

Fix the issue where players are able to move before authentication. Movement must be completely blocked until the player get authenticated.

Add configuration options to customize the void world environment, including:

Day or night setting

World dimension type (e.g., normal, nether, end)

Ensure that every time a player joins or leaves, their gamemode is set to survival. Add an option in config.yml:

on-join-survival: true/false This option should apply to both void spawn mode and default mode, and should be enabled (true) by default.

Do not make any other changes outside of the features listed above.

Kodari AI
KodariApr 6 at 11:56 am 18,891 (v2)

Let me read all relevant files first.

Let me read more files needed.

Now I have everything I need. Here’s my plan:

  • Remove bedrock placement; enable flight in void spawn + always block movement

  • Hide/restore inventory in IsolationManager; block hotbar swaps via PlayerItemHeldEvent

  • Always cancel damage for unauthenticated players (remove config gate)

  • Add on-join-survival, void-time, void-environment config options

  • Set SURVIVAL on join/quit; apply world time/environment on void world creation

Here’s a summary of all changes made:

  • loadVoidWorld() — removed bedrock placement; world environment and time are now read from config (voidspawn.environment, voidspawn.time)

  • IsolationManager — stores the player’s full inventory (storage + armor + offhand), clears it on isolate, and restores it on unisolate (covering both auth success and quit)

  • AuthListener — void spawn now enables allowFlight + setFlying so the player hovers at 0,64,0; movement is now always blocked (no config gate); all damage is always cancelled for unauthenticated players (including void damage, config gate removed); PlayerItemHeldEvent cancels hotbar slot switching; onInventoryOpen/onInventoryClick always cancel (config gate removed); gamemode set to SURVIVAL on join and quit when on-join-survival: true

  • ConfigManager — added isOnJoinSurvival(), getVoidTime(), getVoidEnvironment()

  • config.yml — added on-join-survival: true, voidspawn.time: 0, voidspawn.environment: NORMAL

S

voidspawn player cords 0,0,0

Kodari AI
KodariApr 6 at 11:59 am 5,863 (v2)

Two spots to fix: the teleport location in AuthListener (Y=64 → Y=0) and the spawn location set in PmcAuth (Y=64 → Y=0).

Both the player teleport destination and the void world’s spawn point are now set to 0, 0, 0.

S

player is able to move without auth fix because plugins has own systems make an system incide the plugin like you make to stop commands to logging

Kodari AI
KodariApr 6 at 1:32 pm 8,200 (v2)

The current onPlayerMove event fires at LOWEST priority, but other plugins (or the server itself in some cases) can still process movement. The fix is to intercept movement packets at the Netty level — the same way commands are intercepted — so no plugin or event system can bypass it.

  • Add movement packet class names detection in PacketInterceptor (drop them at channel level for unauthenticated players)

  • Keep the PlayerMoveEvent handler as a secondary fallback

  • Change its priority to HIGHEST so it runs last and overrides everything

Two changes made:

  1. PacketInterceptor — adds isMovementPacket() which detects any ServerboundMovePlayerPacket or ServerboundMoveVehiclePacket by full class name (covers all inner classes like Pos, PosRot, Rot, StatusOnly) and silently drops them at the Netty channel level before they ever reach Bukkit, making it impossible for any other plugin to process that movement.

  2. AuthListener — upgrades onPlayerMove priority from LOWEST to HIGHEST with ignoreCancelled = false so it acts as a final fallback and overrides any other plugin that may have re-allowed movement at a lower priority.

S

not fixed

Kodari AI
KodariApr 6 at 1:46 pm 808 (v2)

What’s the issue? Please describe what’s not working — error messages, symptoms, or what behavior you’re seeing would help me understand the problem.

S

player can move without auth

Kodari AI
KodariApr 6 at 1:48 pm 6,603 (v2)

Let me read the relevant files to diagnose this properly.

Root Cause Analysis

There are two concrete bugs causing this:


Bug 1 — Premium auto-login race window (most impactful)

In AuthListener.onPlayerJoin, when isPremiumAutoLogin is enabled:

Java
plugin.getPremiumChecker().isPremium(player.getUniqueId()).thenAccept(isPremium -> {
    plugin.getServer().getScheduler().runTask(plugin, () -> {
        if (isPremium && player.isOnline()) { ... }
        else { startAuthProcess(player); }  // <-- called LATE
    });
});

Between the moment the player joins and when the scheduler callback fires (potentially several ticks later), startAuthProcess has not been called. This means:

  • The player is not isolated (inventory not cleared, not hidden)

  • The player is not in authenticatedPlayers — isAuthenticated() returns false via getOrDefault

The move handler does block X/Y/Z during this window. However isolation hasn’t happened, so the player can see the world normally, interact with it via packets, etc. If the scheduler is delayed under load, this window widens significantly.


Bug 2 — onPlayerMove priority allows other plugins to undo the fix

Java
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = false)
public void onPlayerMove(PlayerMoveEvent event) {

HIGHEST means any plugin registered at MONITOR priority fires after this handler and can override the setTo() call you set. Essentials, WorldGuard, and many other common plugins use MONITOR on PlayerMoveEvent. The correct priority here should be MONITOR (the last to run) so your setTo() is the final word.


Summary

#
Location
Problem
1
onPlayerJoin
– premium branch
startAuthProcess
is deferred; player is unguarded for several ticks on join
2
onPlayerMove
–
EventPriority.HIGHEST
Third-party plugins at
MONITOR
priority can override your
setTo()
fix
S

no the reason is plugin is not sending the packets to server to commands don't get logged but make a change this feature only works for commands not for other things like movement

Kodari AI
KodariApr 6 at 1:53 pm 1,139 (v2)

Understanding the Packet Interception Scope

Currently your PacketInterceptor is likely intercepting all packets from unauthenticated players to prevent any server processing.

The change you want is:

Current behavior: Block all packets (movement, commands, interactions, etc.) from reaching the server

Desired behavior: Only intercept command packets specifically, let everything else through normally


Why this matters

  • Movement packets being blocked is actually useful in auth plugins (keeps players frozen) — so you may want to reconsider

  • But if your IsolationManager already handles freezing players via other means (teleporting them back, etc.), then blocking movement packets is redundant

  • Command packets specifically are the ones that could expose sensitive info in logs (e.g. /login MyPassword123)


The specific packet to target

You’d only want to intercept PacketPlayInChat and PacketPlayInCommand (1.19+) packets — these are the ones that carry command input.

Everything else (PacketPlayInFlying, PacketPlayInUseItem, etc.) would be passed through normally.


A question before any changes

Does your IsolationManager already handle player freezing/restriction independently of the PacketInterceptor? That determines whether dropping movement packet interception would cause players to freely roam during auth.

S

no the reason is plugin is not sending the packets to server to commands don't get logged but make a change this feature only works for commands not for other things like movement (make sure don't touch to commands things)

Kodari AI
KodariApr 6 at 1:55 pm 2,459 (v2)

The current code drops movement packets silently (just return) and also silently drops all other unhandled packets. The fix: let movement pass through via super.channelRead, and add a default pass-through at the end for everything that isn’t a command packet.

  • Removed the movement packet drop block entirely — movement now falls through to the new default super.channelRead at the bottom.

  • Added super.channelRead(ctx, msg) as the final fallback so every non-command packet (movement, interactions, etc.) is forwarded to the server normally.

  • Command packets (ServerboundChatCommandPacket, ServerboundChatCommandSignedPacket, ServerboundChatPacket with /) are still intercepted and never forwarded, so they won’t be logged.

S

Remove the /checkpass command completely from the plugin.

Add an /endsession command that allows a player to terminate their own active session, forcing them to log in again.

Add an admin command /pmcauth endsession <player> that allows administrators to terminate another player’s session and require them to relogin.

When a player unregisters or changes their password, automatically kick them from the server and terminate their active session so they must login or register again on next join.

Allow downward movement (falling) for unauthenticated players while still blocking all other movement.

Modify authentication titles so they remain visible continuously until the player successfully logs in or registers.

Prevent /changepass and /unregister commands from being sent to the console or logs, just like you do with auth commands.

Add command suggestions (tab-complete hints) for /login and /register, showing correct usage formats like /login <password> and /register <password>, with full configurability in config.yml. (also add for /changepass and /unregister)

Add a password security system in config.yml to block weak or common passwords. This should include options such as minimum length, and a list of blocked/common passwords that players are not allowed to register using them.

Update all plugin messages, including chat messages and titles, to use a clean and professional tone similar to standard authentication plugins, without using emojis.

Kodari AI
KodariApr 7 at 4:46 am 41,078 (v2)

Let me read all relevant files first.

Now I have a complete picture. Let me plan all changes:

  • Remove /checkpass from PmcAuthCommand, messages, plugin.yml

  • Add EndSessionCommand.java, register /endsession in plugin.yml and PmcAuth.java, add /pmcauth endsession subcommand

  • ChangePassCommand and UnregisterCommand: remove session + kick after action + password security + tab hints

  • AuthListener movement: allow downward Y, block XZ and upward

  • AuthTask: resend title every tick so it stays visible continuously

  • ConfigManager: add password security getters + tab-complete hint getters

  • Update all messages to professional style without emojis

  • ConsoleFilter already handles /changepass and /unregister ✓

Here is a summary of every change made:

  • Removed /checkpass — handleCheckPass, its entry in SUBCOMMANDS, its help line, and all related messages removed from PmcAuthCommand and messages.yml.

  • Added /endsession — New EndSessionCommand.java registered in PmcAuth.java and plugin.yml; calls authManager.startAuthProcess() to force re-authentication. The AuthManager now has a startAuthProcess(Player) method that removes the session, isolates the player, teleports them back to the auth location, sends prompts, starts AuthTask, and starts reminders.

  • Added /pmcauth endsession <player> — New subcommand in PmcAuthCommand that deauths and restarts auth for any online player with tab-complete support for player names.

  • Unregister/ChangePass kick + session termination — Both UnregisterCommand and ChangePassCommand now call sessionManager.removeSession() before kicking. Admin variants in PmcAuthCommand also terminate the session and kick before the success message. /changepass kicks with changepass-player-kick instead of showing a chat success (since the player is disconnected).

  • Falling allowed for unauthenticated players — onPlayerMove in AuthListener now only blocks XZ movement and upward Y movement; downward Y movement (to.getY() < from.getY()) passes through.

  • Persistent auth titles — MessageUtil.sendAuthMessage now uses stay=32767 ticks (~27 min) for the initial title. AuthTask.run() calls the new MessageUtil.refreshAuthTitle() every second (fadeIn=0, stay=40, fadeOut=0), keeping the title continuously visible until the player authenticates.

  • ConsoleFilter already covered /changepass and /unregister — no change needed there.

  • Tab-complete hints — LoginCommand, RegisterCommand, ChangePassCommand, and UnregisterCommand now return configurable hint strings from config.yml under tab-complete.* for each argument position.

  • Password security — config.yml adds password.min-length (default 6) and password.blocked-passwords (common passwords list). ConfigManager exposes getPasswordMinLength(), getBlockedPasswords(), and isPasswordBlocked(). Both RegisterCommand and ChangePassCommand enforce these checks with the new password-blocked and updated password-too-short (supporting {min} placeholder) messages.

  • Professional messages — All messages in messages.yml rewritten with clean, standard auth-plugin phrasing and no emojis.

S

block changepass and unregister using PacketInterceptor just like you do with auth commands to stay hidden from console and logs

Kodari AI
KodariApr 7 at 4:51 am 4,452 (v2)

The interceptor needs CHANGEPASS_ALIASES and UNREGISTER_ALIASES sets, plus instantiated command handlers, and routing logic in both handleCommandPacket and handleLegacyChatPacket.

/changepass and /unregister (and their aliases) are now intercepted at the Netty packet level — they’ll be silently routed to the command handlers without ever touching Bukkit’s command dispatcher or appearing in console logs.

S

titles are showing even after the player gets authenticated don't show titles for permanent on screen only show until the player get authenticated and show other titles for little time . and block unregister and changepass command using packets just like you do with auth commands

Kodari AI
KodariApr 7 at 5:11 am 17,830 (v2)
  • Titles persist after auth: sendAuthMessage uses stay=32767 (permanent), so the title stays on screen forever. Need to clear it on auth success, and use a short duration for success/transient titles.

  • Changepass/unregister not blocked by packet interceptor: They’re currently allowed through (their handlers check auth themselves), but they should be packet-blocked like other commands when unauthenticated.

  • Fix: clear title in AuthManager, add sendTransientAuthMessage in MessageUtil, use it in login/register success, and remove changepass/unregister from the interceptor’s allowlist.

Now I have everything. Here are the changes:

  1. MessageUtil — add clearTitle + sendTransientAuthMessage (short stay for success/feedback titles)

  2. AuthManager.setAuthenticated — clear the permanent title on auth success

  3. LoginCommand & RegisterCommand — use sendTransientAuthMessage for success

  4. PacketInterceptor — remove changepass/unregister from the unauthenticated allowlist (block them like any other command)

Summary of all changes:

  • MessageUtil: added clearTitle() (instantly dismisses permanent title) and sendTransientAuthMessage() (fadeIn=10, stay=60, fadeOut=20 — for brief success/feedback titles)

  • AuthManager.setAuthenticated: calls clearTitle(player) immediately when the player authenticates, removing the stuck auth prompt title

  • LoginCommand / RegisterCommand: use sendTransientAuthMessage for success so those titles show briefly and then fade out naturally

  • PacketInterceptor: added SENSITIVE_ALIASES set containing all changepass and unregister aliases; when an unauthenticated player sends those commands they are now dropped at the packet level (same blocked-command treatment as any other command), instead of being forwarded to their handlers

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
35 3,755
src/main/java/com/pmcnetwork/pmcauth/PmcAuth.java
package com.pmcnetwork.pmcauth;

import com.pmcnetwork.pmcauth.command.ChangePassCommand;
import com.pmcnetwork.pmcauth.command.EndSessionCommand;
import com.pmcnetwork.pmcauth.command.LoginCommand;
import com.pmcnetwork.pmcauth.command.PmcAuthCommand;
import com.pmcnetwork.pmcauth.command.RegisterCommand;
import com.pmcnetwork.pmcauth.command.SetAuthLocationCommand;
import com.pmcnetwork.pmcauth.command.UnregisterCommand;
import com.pmcnetwork.pmcauth.listener.AuthListener;
import com.pmcnetwork.pmcauth.manager.AuthManager;
import com.pmcnetwork.pmcauth.manager.BossBarManager;
import com.pmcnetwork.pmcauth.manager.ConfigManager;
import com.pmcnetwork.pmcauth.manager.DatabaseManager;
import com.pmcnetwork.pmcauth.manager.IPBanManager;
import com.pmcnetwork.pmcauth.manager.IsolationManager;
import com.pmcnetwork.pmcauth.manager.LocationManager;
import com.pmcnetwork.pmcauth.manager.MessagesManager;
import com.pmcnetwork.pmcauth.manager.MultiLoginManager;
import com.pmcnetwork.pmcauth.manager.PlayerDataManager;
import com.pmcnetwork.pmcauth.manager.ReminderManager;
import com.pmcnetwork.pmcauth.manager.SeasonManager;
import com.pmcnetwork.pmcauth.manager.SessionManager;
import com.pmcnetwork.pmcauth.util.ConsoleFilter;
import com.pmcnetwork.pmcauth.util.PremiumChecker;
import com.pmcnetwork.pmcauth.util.VoidWorldGenerator;
import lombok.Getter;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.logging.Filter;
import java.util.logging.Logger;

@Getter
public class PmcAuth extends JavaPlugin {

    private ConfigManager configManager;
    private MessagesManager messagesManager;
    private DatabaseManager databaseManager;
    private AuthManager authManager;
    private PlayerDataManager playerDataManager;
    private SeasonManager seasonManager;
    private SessionManager sessionManager;
    private BossBarManager bossBarManager;
    private IsolationManager isolationManager;
    private LocationManager locationManager;
    private IPBanManager ipBanManager;
    private ReminderManager reminderManager;
    private MultiLoginManager multiLoginManager;
    private PremiumChecker premiumChecker;
    private World voidWorld;

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

        this.configManager = new ConfigManager(this);
        this.messagesManager = new MessagesManager(this);
        this.databaseManager = new DatabaseManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.sessionManager = new SessionManager(this);
        this.authManager = new AuthManager(this);
        this.seasonManager = new SeasonManager(this);
        this.bossBarManager = new BossBarManager(this);
        this.isolationManager = new IsolationManager(this);
        this.locationManager = new LocationManager(this);
        this.ipBanManager = new IPBanManager(this);
        this.reminderManager = new ReminderManager(this);
        this.multiLoginManager = new MultiLoginManager();
        this.premiumChecker = new PremiumChecker();

        if (configManager.isVoidSpawnEnabled()) {
            loadVoidWorld();
        }

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

        LoginCommand loginCmd = new LoginCommand(this);
        RegisterCommand registerCmd = new RegisterCommand(this);
        PmcAuthCommand pmcAuthCmd = new PmcAuthCommand(this);
        ChangePassCommand changePassCmd = new ChangePassCommand(this);
        UnregisterCommand unregisterCmd = new UnregisterCommand(this);
        EndSessionCommand endSessionCmd = new EndSessionCommand(this);

        getCommand("login").setExecutor(loginCmd);
        getCommand("login").setTabCompleter(loginCmd);
        getCommand("register").setExecutor(registerCmd);
        getCommand("register").setTabCompleter(registerCmd);
        getCommand("pmcauth").setExecutor(pmcAuthCmd);
        getCommand("pmcauth").setTabCompleter(pmcAuthCmd);
        getCommand("setauthlocation").setExecutor(new SetAuthLocationCommand(this));
        getCommand("changepass").setExecutor(changePassCmd);
        getCommand("changepass").setTabCompleter(changePassCmd);
        getCommand("unregister").setExecutor(unregisterCmd);
        getCommand("unregister").setTabCompleter(unregisterCmd);
        getCommand("endsession").setExecutor(endSessionCmd);

        getLogger().info("PmcAuth has been enabled! PMC NETWORK ON TOP");
    }

    private void loadVoidWorld() {
        org.bukkit.World.Environment environment;
        try {
            environment = org.bukkit.World.Environment.valueOf(configManager.getVoidEnvironment().toUpperCase());
        } catch (IllegalArgumentException e) {
            environment = org.bukkit.World.Environment.NORMAL;
        }
        WorldCreator creator = new WorldCreator("pmcauth_void")
                .generator(new VoidWorldGenerator())
                .environment(environment);
        this.voidWorld = creator.createWorld();
        if (this.voidWorld != null) {
            this.voidWorld.setSpawnLocation(0, 0, 0);
            this.voidWorld.setTime(configManager.getVoidTime());
            this.voidWorld.setGameRule(org.bukkit.GameRule.DO_DAYLIGHT_CYCLE, false);
            this.voidWorld.setGameRule(org.bukkit.GameRule.DO_WEATHER_CYCLE, false);
            getLogger().info("[PmcAuth] Void world loaded.");
        }
    }

    private void installConsoleFilter() {
        ConsoleFilter filter = new ConsoleFilter();
        Logger rootLogger = Logger.getLogger("");
        Filter existing = rootLogger.getFilter();
        if (!(existing instanceof ConsoleFilter)) {
            rootLogger.setFilter(filter);
        }
        java.util.logging.Handler[] handlers = rootLogger.getHandlers();
        for (java.util.logging.Handler handler : handlers) {
            Filter handlerFilter = handler.getFilter();
            if (!(handlerFilter instanceof ConsoleFilter)) {
                handler.setFilter(filter);
            }
        }
    }

    @Override
    public void onDisable() {
        if (reminderManager != null) {
            reminderManager.stopAllReminders();
        }
        if (bossBarManager != null) {
            bossBarManager.removeAllBossBars();
        }
        if (isolationManager != null) {
            isolationManager.clearAll();
        }
        if (sessionManager != null) {
            if (!configManager.isPersistSessionsOnRestart()) {
                sessionManager.clearAllSessions();
            }
        }
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        if (databaseManager != null) {
            databaseManager.close();
        }
        getLogger().info("PmcAuth has been disabled!");
    }
}