AntiESP
一个 Paper 插件,通过永远不向客户端发送其本不该看到的信息,使 ESP / 透视 / xray 作弊手段的效果大打折扣。
一个插件包含三项独立的防护功能:
| # |
防护功能 |
作用 |
| 1 |
玩家隐藏 |
对于观察者而言,墙后的玩家会在客户端被移除(可选保留悬浮名称标签及其在列表中的条目)。 |
| 2 |
方块伪装 |
箱子、潜影盒、刷怪笼、 barrels …… 从远处看就像普通的石头。 |
| 3 |
矿石混淆器 |
自写的反 xray:隐藏真实矿石,散布虚假矿脉,并可用实心岩石填充洞穴(防自由视角)。 |
所有功能均可在 config.yml 中配置,且每个功能都可以单独关闭。
要求
- Paper 1.21.8(或兼容版本)——该插件使用 Paper API
- Java 21
- 可选: PacketEvents
— 用于数据包模式(洞穴填充/防自由视角保护)以及在被隐藏玩家时保留在列表中。没有它插件仍能运行,但仅具备方块模式功能集。
安装
- 将
AntiESP-1.0.0.jar 放入服务器的 plugins/ 文件夹。
- (推荐) 也将
PacketEvents 放入 plugins/。
- 启动服务器 —— 首次运行时生成
plugins/AntiESP/config.yml。
- 在启用数据包模式之前,先运行一次
identity-test(见
矿石混淆器)。
从源码构建
mvn clean package
jar 文件位于 target/AntiESP-1.0.0.jar。两个依赖项均为 provided,
因此不会进行阴影打包(shading)—— jar 包保持小巧。
1) 玩家隐藏
对于每一对观察者/目标,插件会进行视线光线追踪
(Amanatides & Woo 体素遍历,RayTracer),并选择以下三种状态之一:
- VISIBLE —— 近距离或在清晰视野内:无任何变化。
- NAMETAG —— 中等距离受阻:玩家模型和碰撞箱被隐藏,
但悬浮名称(代理
TextDisplay)保持可见。
- GONE —— 远距离完全受阻:完全不可见。
隐藏起始于 min-distance(默认 12 格),且只有当中间有超过
walls-to-hide 个不透明方块时才会触发。身体上的多个目标点会被检查 —— 只有当所有点都被遮挡时,玩家才会被隐藏,从而避免有人在角落半可见时突然消失。
关键选项:
| 选项 |
默认值 |
含义 |
check-interval-ticks |
10 |
重新计算可见性的频率 |
min-distance |
12.0 |
低于此距离玩家始终可见 |
max-distance |
96.0 |
检查的上限(0 = 无限制) |
walls-to-hide |
2 |
当墙壁数量大于此值时隐藏 |
require-occlusion |
true |
仅隐藏真正被遮挡的玩家 |
keep-nametags |
true |
为隐藏玩家保留悬浮名称 |
nametag-max-distance |
48.0 |
超出此距离后名称标签也会消失 |
keep-tablist |
true |
在被隐藏状态下仍保留在列表中(需要 PacketEvents) |
潜行会立即隐藏名称标签,而不是等待下一个刻。
注意: 可见的名称标签仍然大致会暴露位置。设置
keep-nametags: false 可获得最强的防护。
2) 方块伪装
有价值的方块实体通过 sendBlockChange 替换为石头(disguise-as),适用于远距离观察或透过墙壁查看的观察者。走近到 reveal-distance 以内时,真实方块会恢复,容器可正常打开。仅使用 Bukkit API —— 无需 ProtocolLib,无需 PacketEvents。
默认情况下,箱子、陷阱箱、末影箱、木桶、漏斗、发射器、投掷器、所有潜影盒、刷怪笼、试炼刷怪笼、保险箱、酿造台、信标、熔炉、高炉、烟熏炉和装饰花瓶都会被伪装。编辑 block-disguise.blocks 列表,或设置 all-block-entities: true 以覆盖所有方块实体(包括告示牌和旗帜 —— 这很明显)。
3) 矿石混淆器 (anti-xray)
一个完全独立的反 xray 实现 —— 不需要 Paper anti-xray,不需要
Orebfuscator。真实矿石被发送为石头/深板岩,并在自然 Y 范围和矿脉尺寸内生长虚假矿脉。
两种模式:
|
方块模式 |
数据包模式(推荐) |
| 需要 PacketEvents |
否 |
是 |
| 隐藏封闭的真实矿石 |
✅ |
✅ |
| 散布虚假矿脉 |
✅ |
✅ |
| 填充小型封闭口袋 |
✅ |
✅ |
| 填充大型开放洞穴(防自由视角) |
❌ |
✅ |
| 原理 |
区块加载后 sendBlockChange |
直接重写 CHUNK_DATA 数据包本身 |
与空气相邻的矿石保持真实 —— 你无论如何都会看到它们 —— 因此世界在玩家可能合法观察到的地方“自我规范化”。在数据包模式下,接近揭示会通过你所在的连通洞穴空气进行泛洪填充,不受方向限制地揭示整个洞穴系统,并在几个刻内分散展开。已揭示的块保持揭示状态直到重新连接。下界和末地完全不进行混淆。
虚假图案的种子源自每次服务器启动时用 SecureRandom 生成的 secretSalt(仅限内存),并与区块坐标进行 XOR 运算:每个区块稳定(无闪烁),但没有盐就无法重现。
首先测试数据包模式。 重写区块二进制格式对版本敏感。设置 ore-obfuscation.identity-test: true,重启,并检查世界是否正常 —— 即解码并重新编码每个区块数据包而不改变任何内容。如果看起来没问题,再将其设回 false。
完整详情、调整建议以及诚实的局限性( notably:任何知道世界种子的人都可以在服务器端重新生成矿石位置,没有任何客户端混淆能阻止这一点)请参阅 docs/ANTI-XRAY.md。
命令与权限
| 命令 |
描述 |
/antiesp reload |
重新加载 config.yml 并清除区块缓存 |
/antiesp status |
显示当前激活的设置、模式及缓存大小 |
| 权限 |
默认值 |
描述 |
antiesp.admin |
op |
访问 /antiesp 命令的权限 |
antiesp.bypass |
false |
该玩家对其他玩家始终可见,并且能看到未经混淆的真实世界 |
packet-mode(数据包模式)和 identity-test(身份测试)仅在服务器重启时生效,不能通过 /antiesp reload 命令即时应用。
项目结构
src/main/java/dev/antiesp/
AntiESPPlugin.java 入口点、事件处理、命令注册
PlayerVisibilityService.java 玩家隐藏 + 代理名称标签
TabListKeeper.java 在标签页列表中保留隐藏玩家(基于 PacketEvents)
BlockDisguiseService.java 容器/实体伪装
OreObfuscationService.java 反透视,区块模式
ChunkPacketObfuscator.java 反透视,数据包模式(重写 CHUNK_DATA 数据包)
ProximityRevealer.java 持续的泛洪填充洞穴揭示
RayTracer.java 用于遮挡计数的体素光线追踪
src/main/resources/
config.yml, plugin.yml
docs/ANTI-XRAY.md 深入的反透视文档(德语)
性能说明
- 数据包模式在 Netty 线程上按区块进行计算;结果会被缓存(
max-cache-chunks,默认值为 6000),并在方块被挖掘时失效。
- 只有玩家破坏方块才会导致缓存失效——目前 TNT、活塞和水不会触发缓存失效。
- 邻近揭示仅在你移动到新的方块、挖掘方块或加入服务器时重新执行泛洪填充;静止不动或转身不会产生额外开销。
AntiESP
A Paper plugin that makes ESP / wallhack / xray cheats far less useful by never
sending the client information it should not be able to see in the first place.
Three independent protections in one plugin:
| # |
Protection |
What it does |
| 1 |
Player hiding |
Players behind walls are removed client-side for the viewer (optionally keeping a floating nametag and their tab-list entry). |
| 2 |
Block disguise |
Chests, shulkers, spawners, barrels … look like plain stone from a distance. |
| 3 |
Ore obfuscator |
Self-written anti-xray: real ores are hidden, fake ore veins are scattered in, and caves can be filled with solid rock (freecam-proof). |
Everything is configurable in config.yml, and every feature can be turned off
individually.
Requirements
- Paper 1.21.8 (or a compatible build) — the plugin uses the Paper API
- Java 21
- Optional: PacketEvents
— required for packet mode (cave filling / freecam protection) and for keeping
hidden players in the tab list. Without it the plugin still runs, just with the
block-mode feature set.
Installation
- Drop
AntiESP-1.0.0.jar into your server's plugins/ folder.
- (Recommended) Drop
PacketEvents into plugins/ as well.
- Start the server —
plugins/AntiESP/config.yml is generated on first run.
- Before going live with packet mode, run the
identity-test once (see
Ore obfuscator).
Building from source
mvn clean package
The jar ends up in target/AntiESP-1.0.0.jar. Both dependencies are provided,
so nothing is shaded in — the jar stays tiny.
1) Player hiding
For every viewer/target pair the plugin ray-traces the line of sight
(Amanatides & Woo voxel traversal, RayTracer) and picks one of three states:
- VISIBLE — close by or in clear sight: nothing changes.
- NAMETAG — occluded at medium range: the player model and hitbox are hidden,
but a floating name (a proxy
TextDisplay) stays visible.
- GONE — occluded and far away: completely invisible.
Hiding starts at min-distance (default 12 blocks) and only when more than
walls-to-hide opaque blocks are in the way. Several target points on the body
are checked — a player is only hidden when all of them are occluded, so nobody
pops out of existence while half-visible around a corner.
Key options:
| Option |
Default |
Meaning |
check-interval-ticks |
10 |
How often visibility is recalculated |
min-distance |
12.0 |
Below this distance players are always visible |
max-distance |
96.0 |
Upper bound for the check (0 = no limit) |
walls-to-hide |
2 |
Hide when the wall count is greater than this |
require-occlusion |
true |
Only hide genuinely occluded players |
keep-nametags |
true |
Keep the floating name for hidden players |
nametag-max-distance |
48.0 |
Beyond this the nametag disappears too |
keep-tablist |
true |
Keep hidden players in the tab list (needs PacketEvents) |
Sneaking hides the nametag immediately instead of waiting for the next tick.
Note: a visible nametag still roughly gives away a position. Set
keep-nametags: false for the strongest protection.
2) Block disguise
Valuable block-entities are replaced with stone (disguise-as) via
sendBlockChange for viewers that are far away or looking through walls. Walk
closer than reveal-distance and the real block comes back, so containers open
normally. Uses only the Bukkit API — no ProtocolLib, no PacketEvents.
By default chests, trapped chests, ender chests, barrels, hoppers, droppers,
dispensers, all shulker boxes, spawners, trial spawners, vaults, brewing stands,
beacons, furnaces, blast furnaces, smokers and decorated pots are disguised. Edit
the block-disguise.blocks list, or set all-block-entities: true to cover every
block-entity (signs and banners included — this is noticeable).
3) Ore obfuscator (anti-xray)
A fully self-contained anti-xray implementation — no Paper anti-xray, no
Orebfuscator. Real ores are sent as stone/deepslate and fake ore veins are grown
in natural Y ranges and vein sizes.
Two modes:
|
Block mode |
Packet mode (recommended) |
| Needs PacketEvents |
no |
yes |
| Hide enclosed real ores |
✅ |
✅ |
| Scatter fake ore veins |
✅ |
✅ |
| Fill small enclosed pockets |
✅ |
✅ |
| Fill large open caves (freecam-proof) |
❌ |
✅ |
| How |
sendBlockChange after chunk load |
rewrites the CHUNK_DATA packet itself |
Ores that border air are left real — you would see them anyway — so the world
"normalizes" itself exactly where a player could legitimately look. In packet
mode a proximity reveal flood-fills through the connected cave air you are
standing in and uncovers the whole cave system, direction-independently, spread
across a few ticks. Revealed blocks stay revealed until relog. Nether and End are
not obfuscated at all.
The fake pattern is seeded from a secretSalt generated with SecureRandom at
every server start (RAM only) XOR'd with the chunk coordinates: stable per chunk
(no flickering), but not reproducible without the salt.
Test packet mode first. Rewriting the chunk binary format is version
sensitive. Set ore-obfuscation.identity-test: true, restart, and check that
the world looks normal — that decodes and re-encodes every chunk packet without
changing anything. If it looks fine, set it back to false.
Full details, tuning advice and the honest limitations (notably: anyone who
knows the world seed can regenerate ore positions server-side, no client-side
obfuscation can prevent that) are in docs/ANTI-XRAY.md.
Commands & permissions
| Command |
Description |
/antiesp reload |
Reload config.yml and clear the chunk cache |
/antiesp status |
Show the active settings, mode and cache sizes |
| Permission |
Default |
Description |
antiesp.admin |
op |
Access to /antiesp |
antiesp.bypass |
false |
This player is never hidden from others and sees the real, unobfuscated world |
packet-mode and identity-test are only applied on a server restart, not
via /antiesp reload.
Project layout
src/main/java/dev/antiesp/
AntiESPPlugin.java entry point, events, commands
PlayerVisibilityService.java player hiding + proxy nametags
TabListKeeper.java keeps hidden players in the tab list (PacketEvents)
BlockDisguiseService.java container/block-entity disguise
OreObfuscationService.java anti-xray, block mode
ChunkPacketObfuscator.java anti-xray, packet mode (CHUNK_DATA rewriting)
ProximityRevealer.java persistent flood-fill cave reveal
RayTracer.java voxel ray tracing for occlusion counting
src/main/resources/
config.yml, plugin.yml
docs/ANTI-XRAY.md in-depth anti-xray documentation (German)
Performance notes
- Packet mode computes per chunk on the Netty threads; results are cached
(
max-cache-chunks, default 6000) and invalidated when blocks are mined.
- Only player block-breaking invalidates the cache — TNT, pistons and water do
not, currently.
- The proximity reveal only re-floods when you move to a new block, mine, or
join; standing still and turning around costs nothing.
评论 0
登录后参与评分
还没有评论,来抢沙发吧