LumoAiDetector

一款免费的 Minecraft 反作弊插件,它会在你的服务器内部训练自己的 AI 模型。它会记录战斗中的视角旋转窗口,剔除不良数据,使用 Java 训练随机森林模型,并在玩家行为可疑时通知你的管理人员。
我最初是为自己的服务器构建了这个插件。一段时间后,我决定将其分享出来。市面上有免费的反作弊方案和一些机器学习实验项目,但我找不到任何一个能完美实现以下完整流程:录制你自己的数据集、在本地训练模型、在游戏中管理模型文件,并确保所有消息均可编辑。
本插件不附带任何预训练模型。你需要自己训练模型。数据质量越高,检测效果越好,而你的玩家群体与我的并不相同。
实际工作原理
该插件监控的是战斗视角旋转,而非随机的鼠标移动。只有当所有条件都满足时,窗口数据才会送入模型:
- 玩家最近进行了攻击或挥动武器。
- 附近有存活的目标,且位于玩家的瞄准锥内。
- 在 15 个刻(tick)的窗口期内,鼠标移动幅度足够大。
- 刻的时间间隔保持在配置的网络延迟范围内。
每个有效的窗口会转换为 120 个数值(15 个刻 × 8 个值:dx, dy, dt, v, a, j, err, derr)。标签仅为 0(正常玩家)和 1(作弊者)。

为什么要训练自己的模型
服务器环境各不相同。不同的玩家、客户端、网络延迟、竞技场、PvP 风格以及作弊设置都会影响模型表现。在一个小型私人环境中训练出的模型可能在演示中表现完美,但在你的服务器上却可能失效。
因此,请录制正常的普通战斗。录制自瞄(cracked aim)和平滑自瞄。录制新手玩家、高手玩家、高和低灵敏度、跳跃、侧移、恐慌性快速甩枪以及失准的情况。当数据集不再过于“干净”时,模型才会变得更智能。

功能特性
- 兼容 Bukkit、Spigot、Paper、Purpur 和 Folia。
- Java 8 字节码目标平台。无需 NMS 或 ProtocolLib。
- 可编辑的
config.yml 和 messages.yml。
- 支持录制正常玩家和作弊者的样本数据。
- 异步随机森林训练,带有日期标记的模型文件和元数据。
- 游戏中支持模型的激活、停用和临时备份。
- 超过配置的可疑百分比阈值时向管理员发送警报,并提供按玩家分组的警报历史记录。
- 支持自动惩罚功能,默认关闭。
- 加载模型时进行 SHA-256 完整性检查。
- 支持按世界禁用、UUID 白名单以及绕过权限。
0.1.2 新增内容
- 可复现的训练:设置
training.seed 为固定值,相同的数据集将生成相同的模型。
- 自动类别平衡:针对不平衡的数据集进行优化,防止少量作弊者样本被淹没。
- 诚实的指标显示:当没有验证集保留数据时,插件会明确说明数字来源于训练数据,而不是假装它们是独立的估计值。
/lad models compare <a> <b>:并排比较两个模型。
- 独立的预测线程池:确保模型推理不会阻塞数据集写入。
- 可选的网络延迟范围:跳过在异常延迟下录制的窗口数据。
- 流式数据集计数与修剪:状态和修剪命令不再需要将整个文件加载到内存中。
命令列表
| 命令 |
功能描述 |
/lad record legit|cheater <player> |
开始或停止录制某位玩家的数据。 |
/lad record stop <player|all> |
停止一个或所有正在进行的录制。 |
/lad train |
基于当前数据集训练模型。 |
/lad active <model> |
加载并激活指定模型。 |
/lad deactivate |
停用当前激活的模型。 |
/lad models [page] |
列出已训练的模型。 |
/lad models info <model> |
显示模型的性能指标。 |
/lad models compare <a> <b> |
比较两个模型。 |
/lad delete <model> |
将模型移至备份目录。 |
/lad backup list|restore|purge |
管理备份文件。 |
/lad check <player> [history] |
查看玩家的可疑程度或查看警报历史。 |
/lad status |
查看插件、检测器、模型和数据集的状态。 |
/lad dataset info |
查看数据集的行数、平衡情况和文件大小。 |
/lad dataset trim <rows> |
仅保留最后 N 行数据。 |
/lad reload |
重新加载配置文件和消息文件。 |
快速上手
- 将 jar 文件放入
plugins 文件夹,然后启动服务器一次以生成配置文件。
- 录制正常游戏行为:
/lad record legit <you>。四处移动、跳跃、快速甩枪、平滑追踪、偶尔失准、改变灵敏度等。
- 录制作弊特征:
/lad record cheater <you>。尝试快速自瞄、平滑自瞄、明显的 Killaura 以及细微的视角旋转作弊。
- 训练模型:
/lad train。
- 激活模型:
/lad active <model>。
默认配置较为保守。警报处于开启状态,自动惩罚处于关闭状态。这是有意为之的。在你训练并测试过自己的模型之前,请勿开启惩罚功能。
许可证
Apache License 2.0。版权所有 2026 Lumo (Lumskyy)。
欢迎 Fork、修复和移植。请使用明显不同的名称,并声明你的构建基于 Lumo (Lumskyy) 的 LumoAiDetector。请勿使用我的名称或品牌重新上传。
LumoAiDetector

A free Minecraft anti-cheat that trains its own AI model inside your server. It records combat rotation windows, throws out the bad data, trains a Random Forest model in Java, and warns your staff when a player starts to look suspicious.
I built this for my own server first. After a while I decided to share it. There are free anti-cheats and a few ML experiments around, but I could not find one that does this exact loop: record your own dataset, train a local model, manage the model files in game, and keep every message editable.
No pre-trained model ships with the plugin. You train yours. Better data means a better detector, and your players are not the same as mine.
What it actually does
The plugin watches combat rotations, not random mouse movement. A window only reaches the model when every gate passes:
- The player recently attacked or swung.
- A living target is nearby and inside the player's aim cone.
- The mouse moved enough across the 15 tick window.
- Tick timing stayed inside the configured network range.
Each valid window turns into 120 numbers (15 ticks times 8 values: dx, dy, dt, v, a, j, err, derr). The label is just 0 for legit and 1 for cheater.

Why train your own model
Servers differ. Different players, clients, ping, arenas, PvP styles, and cheat settings. A model trained on one tiny private setup can look amazing in a demo and still fall apart on your server.
So record boring normal fights. Record cracked aim and smooth aim. Record bad players, good players, high and low sensitivity, jumping, strafing, panic flicks, missed hits. The model gets smarter when the dataset stops being too clean.

Features
- Works on Bukkit, Spigot, Paper, Purpur and Folia.
- Java 8 bytecode target. No NMS or ProtocolLib needed.
- Editable
config.yml and messages.yml.
- Dataset recording for legit and cheater samples.
- Async Random Forest training with dated model files and metadata.
- Model activation, deactivation, and temporary backups in game.
- Staff alerts above a configurable suspicion percent, with per-player alert history.
- Auto punishment support, off by default.
- SHA-256 integrity check on model load.
- Per-world disable, UUID whitelist, and a bypass permission.
New in 0.1.2
- Reproducible training. Set
training.seed to a fixed value and the same dataset produces the same model.
- Automatic class balancing for uneven datasets, so a small cheater sample is not drowned out.
- Honest metrics. When there is no validation holdout, the plugin says the numbers came from training data instead of pretending they are an independent estimate.
/lad models compare <a> <b> to put two models side by side.
- A separate prediction thread pool so model inference does not block dataset writing.
- Optional ping band to skip windows recorded under unusual latency.
- Streaming dataset counting and trimming, so status and trim commands no longer load the whole file into memory.
Commands
| Command |
What it does |
/lad record legit|cheater <player> |
Start or stop recording a player. |
/lad record stop <player|all> |
Stop one or all recordings. |
/lad train |
Train a model on the current dataset. |
/lad active <model> |
Load and activate a model. |
/lad deactivate |
Turn off the active model. |
/lad models [page] |
List trained models. |
/lad models info <model> |
Show model metrics. |
/lad models compare <a> <b> |
Compare two models. |
/lad delete <model> |
Move a model to backup. |
/lad backup list|restore|purge |
Manage backups. |
/lad check <player> [history] |
Check suspicion or view alert history. |
/lad status |
Plugin, detector, model and dataset status. |
/lad dataset info |
Dataset rows, balance and file size. |
/lad dataset trim <rows> |
Keep only the last N rows. |
/lad reload |
Reload configs and messages. |
Getting started
- Drop the jar into your
plugins folder and start the server once.
- Record some legit play:
/lad record legit <you>. Move around, jump, flick, track smoothly, miss sometimes, change sensitivity.
- Record cheat profiles:
/lad record cheater <you>. Try fast aim, slow smoothing, obvious Killaura, subtle rotations.
- Train:
/lad train.
- Activate:
/lad active <model>.
The default config is conservative. Alerts are on, auto punishment is off. That is on purpose. Do not turn on punishments until you have trained and tested your own model.
License
Apache License 2.0. Copyright 2026 Lumo (Lumskyy).
Forks, fixes, and ports are welcome. Please use a clearly different name and say your build is based on LumoAiDetector by Lumo (Lumskyy). Do not reupload it under my name or branding.
评论 0
登录后参与评分
还没有评论,来抢沙发吧