AntiBookBan
由 Enea 开发的 Paper 反区块封禁插件。单个 jar 文件兼容 Paper 1.21 → 1.26.2+。
功能:
/scan <player> — 扫描玩家的物品栏(包括离线玩家),并报告超出限制(默认 2 MB)的潜影盒。
/fixall — 扫描所有世界的所有玩家数据(包括离线玩家),并删除超出限制的潜影盒。在每次修改之前,它会创建 <uuid>.dat.bak 备份。
- 书籍限制 — 一本书最多只能有 25 页,且仅允许 ASCII 字符(阻止用于利用漏洞的“奇怪”字符)。
- 加入时自动扫描 — 如果玩家带着可疑的潜影盒加入服务器,操作员会收到通知。
兼容性
| 版本 |
玩家文件 |
状态 |
| 1.21 – 26.0 |
<world>/playerdata/<uuid>.dat |
✅ 已在 1.21 测试 |
| 26.1 – 26.2+ |
<world>/players/data/<uuid>.dat |
✅ 已在 26.2 测试 |
该插件基于 Paper 1.21 API 编译(Paper 保持向后兼容性),并且仅使用稳定的 API:没有 NMS,因此同一个 jar 可以在整个范围内运行。Adventure NBT 已阴影化到 jar 中(重定位),因此它不依赖于服务器的类路径。
命令与权限
| 命令 |
描述 |
权限 |
/scan <player> |
扫描物品栏 + 盔甲 + 副手 + 末影箱(在线或离线) |
antibookban.scan (op) |
/fixall |
从所有玩家数据(离线)和在线物品栏中移除沉重的潜影盒 |
antibookban.fixall (op) |
/abb reload |
重新加载配置文件 |
antibookban.admin (op) |
其他权限:antibookban.notify(接收加入警报,默认为 op)。
配置
max-shulker-size: 2097152 # 潜影盒大小限制(字节,即 2 MB)
max-book-pages: 25 # 最大书籍页数
ascii-only: true # 书籍中仅允许 ASCII 字符
scan-on-join: true # 如果玩家带着可疑潜影盒加入,则通知管理员
fix-ender-chest: true # /fixall 也会检查末影箱
注意:ascii-only: true 还会阻止带音标的字母(è, à...)。如果需要它们,请将其设置为 false。
工作原理
- 在线:每个物品都通过
ItemStack#serializeAsBytes() 序列化为 NBT;如果潜影盒超出限制,则会被报告/移除。
- 离线:
.dat 文件直接使用 Adventure NBT(gzip)进行读写,查找 Inventory 和 EnderItems 列表中的潜影盒,并测量物品的序列化 NBT 大小。受感染的文件正是那些巨大的文件,因此使用了无限制大小的读取器。
未来计划
- 扫描离线玩家数据中的书籍:
/fixall 目前只移除沉重的潜影盒;它可以扩展为也移除页数过多或非 ASCII 字符的书籍。
- 加入时自动移除:与其发出警报,不如立即移除可疑的潜影盒(配置选项)。
- 详细日志:包含日期/时间、玩家和槽位的日志文件,记录每次移除操作。
- 白名单/黑名单:排除某些世界或玩家参与扫描。
- Discord/webhook 通知:当
/fixall 发现内容时发送通知。
- bStats:用于使用统计。
AntiBookBan
Paper anti-chunk ban plugin by Enea. A single jar compatible with Paper 1.21 → 1.26.2+.
What it does:
/scan <player> — scans a player's inventory (including offline players) and reports shulker boxes that exceed the limit (default 2 MB).
/fixall — scans all player data of all worlds (including offline players) and deletes shulker boxes that exceed the limit. Before each modification it creates a <uuid>.dat.bak backup.
- Book limits — a book can have at most 25 pages and ASCII characters only (blocks the "weird" characters used for the exploit).
- Automatic scan on join — if a player joins with a suspicious shulker, operators are notified.
Compatibility
| Version |
Player file |
Status |
| 1.21 – 26.0 |
<world>/playerdata/<uuid>.dat |
✅ tested on 1.21 |
| 26.1 – 26.2+ |
<world>/players/data/<uuid>.dat |
✅ tested on 26.2 |
The plugin is compiled against the Paper 1.21 API (Paper maintains backward compatibility) and uses only stable APIs: no NMS, so the same jar runs across the whole range. Adventure NBT is shaded into the jar (relocated), so it does not depend on the server's classpath.
Commands and permissions
| Command |
Description |
Permission |
/scan <player> |
Scans inventory + armor + offhand + ender chest (online or offline) |
antibookban.scan (op) |
/fixall |
Removes heavy shulkers from ALL player data (offline) and from online inventories |
antibookban.fixall (op) |
/abb reload |
Reloads the config |
antibookban.admin (op) |
Other permissions: antibookban.notify (receives join alerts, op by default).
Configuration
max-shulker-size: 2097152 # shulker limit in bytes (2 MB)
max-book-pages: 25 # maximum book pages
ascii-only: true # ASCII characters only in books
scan-on-join: true # notify ops if a player joins with suspicious shulkers
fix-ender-chest: true # /fixall also checks the ender chest
Note: ascii-only: true also blocks accented letters (è, à...). If you need them, set it to false.
How it works
- Online: each item is serialized to NBT with
ItemStack#serializeAsBytes(); if a shulker exceeds the limit, it is reported/removed.
- Offline:
.dat files are read/written directly with Adventure NBT (gzip), looking for shulkers in the Inventory and EnderItems lists and measuring the item's serialized NBT size. The infected files are precisely the huge ones, so an unlimited-size reader is used.
Future ideas
- Scan books in offline player data:
/fixall currently removes only heavy shulkers; it could be extended to also remove books with too many pages/non-ASCII characters.
- Automatic removal on join: instead of alerting, remove the suspicious shulker immediately (config option).
- Detailed log: log file with date/time, player and slot for every removal.
- Whitelist/blacklist: exclude certain worlds or players from the scan.
- Discord/webhook notifications when
/fixall finds something.
- bStats for usage statistics.
评论 0
登录后参与评分
还没有评论,来抢沙发吧