Ghosty ?
一个服务端可配置的 Fabric 模组,用于防止实体透视(Anti-EntityESP)。
Ghosty 位于原版服务器的实体追踪器与客户端之间。一旦原版服务器开始为某个玩家追踪实体,Ghosty 就会智能地拦截并过滤网络数据包(更新信息)。它能阻止客户端接收它们本不应看到的实体的更新信息(例如被墙壁遮挡或位于玩家身后的实体),从而有效中和实体透视和穿墙作弊。
功能特性
Ghosty 对已追踪的实体应用以下检查,以决定是否向客户端发送更新:
- 距离检查: 停止更新超出配置可视范围的实体。
- 视野角 (FOV) 检查: 除非实体处于极近距离,否则阻止更新位于玩家视野角之外的实体。
- 遮挡检查(光线投射): 如果实体完全被不透明方块遮挡,则智能阻止其实体更新。
配置
安装此模组并运行一次服务器,将在 config/ghosty.json 生成默认配置文件。
默认配置
{
"tracking": {
"range": {
"bypassFovCheckMaxDistance": 6.0,
"enterDistance": 8.0,
"exitDistance": 12.0
},
"fov": {
"enterAngle": 45.0,
"exitAngle": 60.0
},
"rayCastSamples": [
[0.5, 0.5, 0.5],
[0.1, 0.1, 0.1],
[0.9, 0.1, 0.1],
[0.1, 0.9, 0.9],
[0.9, 0.9, 0.9],
[0.5, 1.0, 0.5],
[0.5, 0.0, 0.5],
[0.5, 0.5, 0.1],
[0.5, 0.5, 0.9]
]
},
"shouldDespawn": false,
"cache": {
"forceRefreshNTicks": 5,
"byPlayer": {
"yawChangedThreshold": 10.0,
"pitchChangedThreshold": 10.0
},
"byTarget": {
"positionMovedThreshold": 1.0
}
}
}
配置指南
| 配置键 |
描述 |
bypassFovCheckMaxDistance |
绝对距离阈值。在此距离范围内的实体将完全绕过 FOV 检查,只要未被遮挡,就一定会向客户端发送更新(防止“突然转身”带来的惊吓)。 |
enterDistance |
隐藏实体变为可见(开始向客户端发送更新)的距离阈值。 |
exitDistance |
可见实体变为隐藏(停止向客户端发送更新)的距离阈值。(注:将 exit 值设置得高于 enter 值可产生滞后效应,防止玩家在边界线上行走时实体闪烁)。 |
enterAngle |
隐藏实体变为可见(开始更新)的 FOV 角度阈值。 |
exitAngle |
可见实体变为隐藏(停止更新)的 FOV 角度阈值。 |
rayCastSamples |
应用于实体包围盒以进行遮挡检查的相对坐标矩阵。增加采样点可提高准确性(例如检测突出的武器),但会消耗更多 CPU 资源。 |
shouldDespawn |
当 Ghosty 停止更新某个实体时,服务器是否应向客户端主动发送“消失”数据包。默认为 false。注意: 启用此选项可能导致客户端视觉故障,例如披风物理效果重置或实体重新出现时向上飞行。 |
forceRefreshNTicks |
基于时间的缓存失效。每 N 个刻对所有玩家追踪的所有实体重新计算可见性。 |
yawChangedThreshold |
旋转缓存失效。如果玩家的偏航角(水平视角)变化超过此值,将触发可见性重新计算。 |
pitchChangedThreshold |
旋转缓存失效。如果玩家的俯仰角(垂直视角)变化超过此值,将触发可见性重新计算。 |
positionMovedThreshold |
位置缓存失效。如果目标实体自上次检查以来移动距离超过该值的平方,将为追踪它的玩家触发重新计算。 |
开发者 API(可编程过滤器)
Ghosty 提供了事件接口,允许其他模组挂钩并动态修改可见性逻辑。
设置
- 按照以下说明中的指示,通过 JitPack 添加依赖项:
- 导入事件类:
me.lightsing.minecraft.ghosty.api.EntityVisibilityEvents
- 将你的事件监听器注册到
EntityVisibilityEvents.PRE 和/或 EntityVisibilityEvents.POST。
EntityVisibilityEvents.PRE
此事件在内部 Ghosty 检查(距离、FOV、遮挡)之前触发。它对于白名单特定实体(如宠物、发光实体或 Boss 怪物)非常有用,这些实体一旦被原版追踪器选中,就应始终渲染给客户端。
签名: (ServerPlayer player, Entity target) -> InteractionResult
- 返回
InteractionResult.FAIL 以跳过所有后续 Ghosty 检查,并强制向客户端发送实体更新。
- 返回
InteractionResult.PASS 以不做任何操作,让 Ghosty(或其他挂钩)正常处理可见性。
EntityVisibilityEvents.POST
此事件在所有内部检查完成计算后触发,包含 Ghosty 的最终可见性决策。这允许你在拦截或发送数据包之前就地修改更新行为。
签名: (EntityVisibilityCheckEvent event) -> InteractionResult
- 返回除
InteractionResult.PASS 以外的任何值,以拦截事件并停止将其传播到其他注册的 POST 钩子。
Ghosty ?
A server-side configurable Anti-EntityESP Fabric mod.
Ghosty sits between the vanilla server's entity tracker and the client. Once the vanilla server starts tracking an entity for a player, Ghosty intelligently intercepts and filters the network packets (updates). It prevents clients getting updates from entities they shouldn't be able to see (e.g., behind walls or behind the player), effectively neutralizing Entity ESP and Wallhack cheats.
Features
Ghosty applies the following checks to determine if a tracked entity should update to the client:
- Range Check: Stops updating tracked entities that are outside the configured visual range.
- FOV Check: Prevents updating entities outside of the player's Field of View, unless they are in extremely close proximity.
- Occlusion Check (Raycast): Intelligently blocks entity updates if they are fully obstructed by opaque blocks.
Configuration
Run the server with this mod installed once to generate the default configuration file at config/ghosty.json.
Default Config
{
"tracking": {
"range": {
"bypassFovCheckMaxDistance": 6.0,
"enterDistance": 8.0,
"exitDistance": 12.0
},
"fov": {
"enterAngle": 45.0,
"exitAngle": 60.0
},
"rayCastSamples": [
[0.5, 0.5, 0.5],
[0.1, 0.1, 0.1],
[0.9, 0.1, 0.1],
[0.1, 0.9, 0.9],
[0.9, 0.9, 0.9],
[0.5, 1.0, 0.5],
[0.5, 0.0, 0.5],
[0.5, 0.5, 0.1],
[0.5, 0.5, 0.9]
]
},
"shouldDespawn": false,
"cache": {
"forceRefreshNTicks": 5,
"byPlayer": {
"yawChangedThreshold": 10.0,
"pitchChangedThreshold": 10.0
},
"byTarget": {
"positionMovedThreshold": 1.0
}
}
}
Configuration Guide
| Configuration Key |
Description |
bypassFovCheckMaxDistance |
Absolute distance threshold. Entities within this range bypass the FOV check entirely and will always update to the client if not occluded (prevents "turn-around" jump scares). |
enterDistance |
Distance threshold for a hidden entity to become visible (start updating to client). |
exitDistance |
Distance threshold for a visible entity to become hidden (stop updating to client). (Note: Keeping exit higher than enter creates hysteresis, preventing entities from flickering when walking exactly on the border). |
enterAngle |
FOV angle threshold for a hidden entity to become visible (start updating). |
exitAngle |
FOV angle threshold for a visible entity to become hidden (stop updating). |
rayCastSamples |
A matrix of relative coordinates applied to the entity's bounding box for occlusion checking. Increasing points improves accuracy (e.g., catching protruding weapons) but costs more CPU cycles. |
shouldDespawn |
Whether the server should actively send "Despawn" packets to clients when Ghosty stops updating an entity. Defaults to false. Note: Enabling this can lead to client-side visual glitches, such as cape physics resetting or flying upwards when the entity reappears. |
forceRefreshNTicks |
Time-based cache invalidation. Re-calculates visibility for all tracked entities for every player every N ticks. |
yawChangedThreshold |
Rotational cache invalidation. If a player's yaw (horizontal look) changes by more than this value, it triggers a visibility recalculation. |
pitchChangedThreshold |
Rotational cache invalidation. If a player's pitch (vertical look) changes by more than this value, it triggers a visibility recalculation. |
positionMovedThreshold |
Positional cache invalidation. If a target entity moves further than this distance squared since the last check, it triggers a recalculation for players tracking it. |
Developer API (Programmable Filters)
Ghosty provides events to let other mods hook into and modify the visibility logic dynamically.
Setup
- Add the dependency from JitPack by following the instructions at:
- Import the event class:
me.lightsing.minecraft.ghosty.api.EntityVisibilityEvents
- Register your event listeners to
EntityVisibilityEvents.PRE and/or EntityVisibilityEvents.POST.
EntityVisibilityEvents.PRE
This event is fired before any internal Ghosty checks (Range, FOV, Occlusion) occur. It is highly useful for whitelisting specific entities (like pets, glowing entities, or boss monsters) that should always be rendered to the client once the vanilla tracker picks them up.
Signature: (ServerPlayer player, Entity target) -> InteractionResult
- Return
InteractionResult.FAIL to skip all subsequent Ghosty checks and force the entity to be updated to the client.
- Return
InteractionResult.PASS to do nothing and let Ghosty (or other hooks) process the visibility normally.
EntityVisibilityEvents.POST
This event is fired after all internal checks have finished computing, containing Ghosty's final visibility decision. This allows you to modify the update behavior in-place before packets are intercepted or sent.
Signature: (EntityVisibilityCheckEvent event) -> InteractionResult
- Return any value other than
InteractionResult.PASS to intercept the event and stop propagating it to other registered POST hooks.
评论 0
登录后参与评分
还没有评论,来抢沙发吧