chauw9

Nếu như bạn đã từng nghe qua plugin AntiSpoof Pro, có thể bạn sẽ thắc mắc: Làm sao mà nó có thể phát hiện được mình đang cài mod gì?

Thực ra, nó tận dụng 1 lỗi của Minecraft bản 1.20 trở lên. Bình thường khi 1 mod được cài đặt, nó sẽ có 1 hoặc nhiều file language. Các file language đó là để dịch các key thô (Ví dụ như description.module.kill-aura -> Kill Aura) và nó chia ra thành nhiều ngôn ngữ đề nó có thể hiện nội dung theo ngôn ngữ client đang chọn mà không phải mất công dịch từng dòng trong source code. Vì các bản dịch này không chỉ giới hạn ở phía client (client-side) mà đôi khi nó cũng được gửi lên server (thông qua sign, anvil) nên server đã lợi dụng lỗ hổng này để phát hiện các mod mà người chơi đang cài

Bằng cách buộc người chơi mở 1 cái sign có chứa các "translatable key" trùng với key của các mod công khai như Meteor Client, ThunderHack, CatLean, ... (hoặc anvil có chứa item với tên là các translatable key ấy), client sẽ tự động dịch chúng ra (Ví dụ, server gửi sign có chứa translatable key là descriptions.combat.aimbot, nếu như player đang cài ThunderHack, nó sẽ tự động dịch cụm đó thành Smooth legit aiming.). Sau đó, để lấy kết quả kiểm tra bản dịch, server sẽ bắt buộc người chơi đóng INVENTORY GUI đó ngay lập tức rồi kiểm tra các key. Nếu như có key nào tương ứng với mod nào bị client dịch ra, thì có nghĩa là client đang cài mod đó (Vì trên thực tế, plugin dạng đó sẽ gửi packet với cực nhiều translation key cùng 1 lúc để tiết kiệm thời gian kiểm tra)

Vậy có cách nào để bypass được không? Thực ra là có, bằng cách xoá/chỉnh sửa file lang để nó không dịch ra được nữa. Nhưng đồng nghĩa với việc bạn sẽ phải tự mò các chức năng trên client vì bây giờ nó chỉ còn là các key thô. Việc spoof "client brand" là vô tác dụng đối với kiểu kiểm tra này!

TL;DR: Server sử dụng lỗ hổng bản dịch của Minecraft để kiểm tra mod của người chơi

Kodari AI
KodariMay 23 at 10:32 am 13,671 (v2)
AntiModDetect
A server-side plugin that detects client-side mods (Meteor Client, ThunderHack, CatLean, etc.) by exploiting Minecraft 1.20+ translation key behavior. Forces players to open a Sign/Anvil GUI containing mod-specific translatable keys; if the client translates them, the mod is detected. Supports configurable mod key lists, punishment actions, logging, and bypass prevention. Works independently of client brand spoofing.

Here’s how I’ll structure this:

  • AntiModDetect.java — Main plugin class

  • ModKeyRegistry.java — Holds all translatable keys per mod

  • DetectionSession.java — Tracks per-player detection state

  • DetectionManager.java — Orchestrates sign/anvil sending and result evaluation

  • DetectionListener.java — Listens for inventory close + sign/anvil packets

  • PunishmentManager.java — Executes configured punishments

  • ConfigManager.java — Wraps config.yml

  • DetectCommand.java — /antimod check <player> command

  • plugin.yml + config.yml

I’ll use ProtocolLib to inject the fake Sign/Anvil GUI packets and intercept the response packets without actually placing blocks.

Now I have everything I need. Let me plan the full implementation:

  • ProtocolLib to send fake OPEN_SIGN_EDITOR + OPEN_WINDOW (anvil) packets and intercept UPDATE_SIGN / ITEM_NAME response packets

  • DetectionSession tracks which keys were sent and which came back translated

  • DetectionManager sends batched translatable keys, schedules forced close, evaluates results

  • PunishmentManager runs configured commands on detection

  • ConfigManager wraps all config values

  • DetectCommand for manual /antimod check <player>


Here’s a summary of what was built:

How the detection works (end-to-end):

  1. DetectionManager.startCheck(player) — Sends two fake packets to the player:

    • A BLOCK_CHANGE placing a phantom OAK_SIGN at y=-64 (void, never a real block)

    • A TILE_ENTITY_DATA packet filling the sign’s lines with {"translate":"<mod.key>"} JSON components — up to 4 keys per sign

    • An OPEN_SIGN_EDITOR packet to force the client to open the sign GUI

  2. Client-side — If the player has a mod installed (e.g. Meteor Client), their client automatically resolves {"translate":"meteor-client.module.kill-aura.description"} → "Kills entities around you" before displaying it in the sign editor

  3. DetectionListener — After close-delay ticks, a CLOSE_WINDOW packet is sent, forcing the client to submit the sign via UPDATE_SIGN. The listener intercepts this C→S packet, cancels it (so no real sign is written), and passes the returned lines to handleSignResponse()

  4. handleSignResponse() — Compares each returned line against the raw key that was sent. If they differ, the client translated it → mod detected → PunishmentManager.punish() fires configured console commands

Key design decisions:

  • All keys across all mods are batched (first 4 sent per sign check — expandable to multiple sign rounds)

  • antimoddetect.bypass permission skips checks entirely

  • Per-mod AND catch-all (ALL) punishment commands supported

  • Auto-scan interval configurable; set to 0 to disable passive scanning

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
10 980
src/main/java/com/anticlient/antimoddetect/AntiModDetect.java
package com.anticlient.antimoddetect;

import com.anticlient.antimoddetect.command.DetectCommand;
import com.anticlient.antimoddetect.detection.DetectionManager;
import com.anticlient.antimoddetect.detection.DetectionListener;
import com.anticlient.antimoddetect.config.ConfigManager;
import com.anticlient.antimoddetect.punishment.PunishmentManager;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

@Getter
public class AntiModDetect extends JavaPlugin {

    @Getter
    private static AntiModDetect instance;

    private ConfigManager configManager;
    private DetectionManager detectionManager;
    private PunishmentManager punishmentManager;
    private ProtocolManager protocolManager;
    private BukkitTask scanTask;

    @Override
    public void onEnable() {
        instance = this;

        saveDefaultConfig();
        this.configManager = new ConfigManager(this);
        this.protocolManager = ProtocolLibrary.getProtocolManager();
        this.punishmentManager = new PunishmentManager(this);
        this.detectionManager = new DetectionManager(this);

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

        new DetectCommand(this).register();

        scheduleScanTask();

        getLogger().info("AntiModDetect enabled. Monitoring " + configManager.getModKeys().size() + " mod(s).");
    }

    @Override
    public void onDisable() {
        if (scanTask != null) {
            scanTask.cancel();
        }
        if (detectionManager != null) {
            detectionManager.cleanup();
        }
        getLogger().info("AntiModDetect disabled.");
    }

    public void reload() {
        reloadConfig();
        configManager.reload();
        if (scanTask != null) {
            scanTask.cancel();
            scanTask = null;
        }
        scheduleScanTask();
    }

    private void scheduleScanTask() {
        int intervalSeconds = configManager.getScanInterval();
        if (intervalSeconds <= 0) return;

        long intervalTicks = intervalSeconds * 20L;
        scanTask = Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers()) {
                if (!player.hasPermission("antimoddetect.bypass")) {
                    detectionManager.startCheck(player);
                }
            }
        }, intervalTicks, intervalTicks);
    }
}