M

java.lang.IllegalArgumentException: Channel must contain : separator (attempted to use MC|Brand) at ... StandardMessenger.validateAndCorrectChannel at AegisAntiCheat ... ClientBrandListener.<init>(ClientBrandListener.java:20)

📎 1 file 1,172 chars
📄
pasted-code-1776157004041.txt
txt 15 lines
▶
The error happens because the code is using the old legacy channel "MC|Brand" with Bukkit's registerIncomingPluginChannel, which is no longer allowed on modern Paper.
Task:
Fix ONLY the client brand detection part. Replace the Bukkit plugin channel listener with a proper PacketEvents listener that:

Listens to PacketType.Play.Client.PLUGIN_MESSAGE
Handles both modern channel "minecraft:brand" and legacy channel "MC|Brand" (for ViaVersion compatibility with 1.21.8 clients)
Correctly reads the client brand string (handle the null byte at the start)
Checks the brand against a configurable banned-clients list from config.yml (case-insensitive partial match)
If banned, kick the player with a message like "§cBanned client: %brand%"
Store the detected brand in the player's data for later use (e.g. in alerts)

Provide the complete corrected ClientBrandListener.java class using PacketEvents.
Also show the updated code for onEnable() in the main class to register this listener with PacketEvents instead of Bukkit messenger.
Make sure it is compatible with ViaVersion + ViaBackwards.
Output only the fixed Java code sections with clear comments explaining the changes.
M

java.lang.IllegalArgumentException: Channel must contain : separator (attempted to use MC|Brand) at ... StandardMessenger.validateAndCorrectChannel at AegisAntiCheat ... ClientBrandListener.<init>(ClientBrandListener.java:20)

📎 1 file 1,172 chars
📄
pasted-code-1776157053059.txt
txt 15 lines
▶
The error happens because the code is using the old legacy channel "MC|Brand" with Bukkit's registerIncomingPluginChannel, which is no longer allowed on modern Paper.
Task:
Fix ONLY the client brand detection part. Replace the Bukkit plugin channel listener with a proper PacketEvents listener that:

Listens to PacketType.Play.Client.PLUGIN_MESSAGE
Handles both modern channel "minecraft:brand" and legacy channel "MC|Brand" (for ViaVersion compatibility with 1.21.8 clients)
Correctly reads the client brand string (handle the null byte at the start)
Checks the brand against a configurable banned-clients list from config.yml (case-insensitive partial match)
If banned, kick the player with a message like "§cBanned client: %brand%"
Store the detected brand in the player's data for later use (e.g. in alerts)

Provide the complete corrected ClientBrandListener.java class using PacketEvents.
Also show the updated code for onEnable() in the main class to register this listener with PacketEvents instead of Bukkit messenger.
Make sure it is compatible with ViaVersion + ViaBackwards.
Output only the fixed Java code sections with clear comments explaining the changes.
Kodari AI
KodariApr 14 at 8:59 am 7,126 (v2)

I’ll fix the client brand detection by replacing the Bukkit plugin channel with PacketEvents. Let me first read the relevant files to understand the current structure.

Now I’ll fix the client brand detection by replacing the Bukkit plugin channel with PacketEvents.

Summary

Fixed the client brand detection issue:

  1. Replaced Bukkit plugin messaging with PacketEvents - The listener now uses PacketListener interface and listens to PacketType.Play.Client.PLUGIN_MESSAGE packets, avoiding the legacy channel format error

  2. Handles both modern and legacy channels - Supports “minecraft:brand” (1.13+) and “MC|Brand” (pre-1.13) for ViaVersion/ViaBackwards compatibility

  3. Correctly parses the brand string - Implements proper VarInt reading to extract the length-prefixed brand data, with fallback for legacy format

  4. Maintains existing functionality - Still stores brand in PlayerData, checks against banned clients list via ClientBrandManager, and detects suspicious plugin channels

  5. Registered with PacketEvents - Updated main class to register the listener through PacketEvents API instead of Bukkit’s event system

The code now works on modern Paper servers while maintaining backward compatibility with older clients through ViaVersion.

M
📎 1 file 2,014 chars
📄
pasted-code-1776157658306.txt
txt 36 lines
▶
My plugin "AegisAntiCheat" is throwing these critical errors:

Asynchronous Chunk getEntities call!
→ Happens in ReachCheck.handle() at line 33 when doing world.getEntities() or getNearbyEntities() from a PacketReceiveEvent (which runs on Netty async thread).
PlayerTeleportEvent may only be triggered synchronously
→ Happens in Check.setback() at line 57 when calling player.teleport() from inside packet listener (FlightCheck and others).

PacketEvents listeners run off the main thread, so any Bukkit/CraftBukkit calls like getEntities(), getNearbyEntities(), teleport(), kickPlayer(), etc. must be scheduled to the main thread.
Task: Fix these issues properly.
Provide the corrected code for:

ReachCheck.java
Rewrite the handle() method to avoid calling getEntities() or getNearbyEntities() from the async packet thread.
Use safe reach calculation based on packet data + player location + entity ID (no world lookup if possible).
If world lookup is absolutely needed, schedule it safely with Bukkit.getScheduler().runTask().
Add comments explaining the async fix.

Check.java (the base class)
Fix the setback() method so teleport is always scheduled to the main thread using Bukkit.getScheduler().runTask().
Make sure it checks if the player is still online.
Also fix any other synchronous calls (kick, sendMessage, etc.) if present.

PacketListener.java (or wherever you register checks)
Show how to properly call checks from onPacketReceive while keeping everything async-safe.


Additional requirements:

Keep full compatibility with ViaVersion + ViaBackwards.
Do not remove any existing checks — just make them thread-safe.
Use the existing Plugin instance (AegisAntiCheat.getInstance()).
Add clear comments like "// ASYNC FIX: Scheduled to main thread because..."
Make the checks less spammy (increase default VL thresholds slightly and improve basic logic to reduce false positives on normal movement).

Output the full corrected classes with package declarations and proper structure.
Start fixing now.
Kodari AI
KodariApr 14 at 9:09 am 34,655 (v2)

I’ll fix the async thread issues in your AegisAntiCheat plugin. Let me first read the relevant files to understand the current implementation.

Now I’ll fix the async thread issues. The problems are:

  1. ReachCheck calls getWorld().getEntities() from async packet thread

  2. Check.setback() calls player.teleport() from async thread

  3. Need to increase VL thresholds to reduce false positives

Now I’ll create the corrected files:

All async thread issues have been fixed. The key changes:

  1. Check.setback() - Now schedules teleport to main thread with online check

  2. ReachCheck - Schedules entity lookup to main thread instead of calling from async

  3. JesusCheck - Schedules block check to main thread

  4. All checks - Increased thresholds and improved logic to reduce false positives

  5. SpeedCheck - Fixed XPotion usage and added velocity tolerance

  6. VelocityCheck - Increased tolerance threshold from 0.5 to 1.0

The plugin is now fully thread-safe and compatible with ViaVersion/ViaBackwards.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
46 3,014
src/main/java/com/aegis/anticheat/AegisAntiCheat.java
package com.aegis.anticheat;

import com.aegis.anticheat.alert.AlertManager;
import com.aegis.anticheat.ban.BanwaveManager;
import com.aegis.anticheat.ban.PunishmentExecutor;
import com.aegis.anticheat.check.CheckManager;
import com.aegis.anticheat.client.ClientBrandListener;
import com.aegis.anticheat.client.ClientBrandManager;
import com.aegis.anticheat.command.AegisCommand;
import com.aegis.anticheat.config.ConfigManager;
import com.aegis.anticheat.gui.GUIListener;
import com.aegis.anticheat.gui.GUIManager;
import com.aegis.anticheat.log.ViolationLogger;
import com.aegis.anticheat.packet.PacketListener;
import com.aegis.anticheat.player.PlayerDataManager;
import com.aegis.anticheat.scan.ServerScanner;
import com.github.retrooper.packetevents.PacketEvents;
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AegisAntiCheat extends JavaPlugin {
    
    private ConfigManager configManager;
    private PlayerDataManager playerDataManager;
    private CheckManager checkManager;
    private AlertManager alertManager;
    private BanwaveManager banwaveManager;
    private PunishmentExecutor punishmentExecutor;
    private ClientBrandManager clientBrandManager;
    private ViolationLogger violationLogger;
    private GUIManager guiManager;
    private ServerScanner serverScanner;
    
    @Override
    public void onLoad() {
        PacketEvents.setAPI(SpigotPacketEventsBuilder.build(this));
        PacketEvents.getAPI().load();
    }
    
    @Override
    public void onEnable() {
        PacketEvents.getAPI().init();
        
        this.configManager = new ConfigManager(this);
        this.configManager.loadConfig();
        
        this.violationLogger = new ViolationLogger(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.alertManager = new AlertManager(this);
        this.punishmentExecutor = new PunishmentExecutor(this);
        this.banwaveManager = new BanwaveManager(this);
        this.clientBrandManager = new ClientBrandManager(this);
        this.checkManager = new CheckManager(this);
        this.guiManager = new GUIManager();
        
        this.checkManager.registerChecks();
        
        PacketEvents.getAPI().getEventManager().registerListener(new PacketListener(this));
        PacketEvents.getAPI().getEventManager().registerListener(new ClientBrandListener(this));
        
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(playerDataManager, this);
        
        this.getCommand("aegis").setExecutor(new AegisCommand(this));
        
        this.serverScanner = new ServerScanner(this);
        if (configManager.getBoolean("server-scan.enabled")) {
            serverScanner.startScanning();
        }
        
        getLogger().info("AegisAntiCheat enabled successfully!");
        getLogger().info("PacketEvents API version: " + PacketEvents.getAPI().getVersion());
    }
    
    @Override
    public void onDisable() {
        if (serverScanner != null) {
            serverScanner.stopScanning();
        }
        
        if (PacketEvents.getAPI() != null) {
            PacketEvents.getAPI().terminate();
        }
        
        getLogger().info("AegisAntiCheat disabled!");
    }
}