? DiolezHitregistry — 消除幽灵击打与 PvP 不同步修复
感受每一次挥击都命中。不再有幽灵击打,不再有橡皮筋式死亡。
适用于 Minecraft 1.21 (Fabric) 的客户端战斗预测 —— 无需任何服务端依赖。
❓ 它解决了什么问题?
你以前肯定有过这种感觉。你对玩家挥击,攻击动画播放,粒子飞溅 —— 但什么也没发生。他们的血量没有变化。你没有造成伤害。服务器不认可这次攻击。
这就是幽灵击打 —— 由你的客户端所见与服务端处理之间的差距引起。延迟越高,情况越严重。
DiolezHitregistry 彻底消除了这种体验问题。
✨ 功能特性
⚔️ 消除幽灵击打
每次挥击都会立即对目标应用视觉上的血量减少。如果服务器确认击中 —— 完美,画面看起来已经正确。如果由于延迟或刻不同步导致服务器拒绝该击中 —— 血条会平滑地回退到真实值。没有突兀的跳变,没有困惑。
? 战斗预测与协调
模组会在你挥击的瞬间为每次攻击打上时间戳,并跟踪基于当前延迟的实时往返时间估算值。它利用此数据校准一个容差窗口 —— 在判定击中为幽灵击打之前给予服务器足够的响应时间。在 150ms+ 的连接下,此窗口会自动扩大以吸收延迟峰值。
? 实用工具的不同步修复
所有以下操作都会立即进行预测,并在服务器不认同时优雅地回滚:
- ? 末影珍珠 —— 投掷时立即显示弧线和轨迹
- ? 弓与弩 —— 发射时预测弹道
- ? 食物与药水 —— 播放消耗动画,无需等待服务器确认
- ? 方块放置 —— 在服务器确认前,方块已出现在世界中
- ? 快捷栏切换 —— 槽位变更即时生效,若服务器拒绝则回滚
? 实时 RTT 校准
模组持续测量你的实际延迟,并利用它动态调整预测窗口 —— 无需手动配置。它在 20ms 延迟下表现良好,在 300ms+ 延迟下依然感觉流畅。
? 调试叠加层(可选)
启用开发者 HUD,实时显示:
- 估算的 RTT 和跨刻边界风险
- 当前目标的视觉 HP 与真实 HP 对比
- 预测状态(待处理 / 已确认 / 已回滚)
- 实体位置误差(服务端目标与你所见位置的偏差距离)
⚙️ 配置
配置文件自动生成于:.minecraft/config/hitregistry.json
| 选项 |
默认值 |
描述 |
enabled |
true |
总开关 |
combatPredictionEnabled |
true |
切换击中预测 |
utilityPredictionEnabled |
true |
切换实用工具的不同步修复 |
hitExpiryTicks |
20 |
在将击中视为幽灵击打之前,等待服务器确认的时间(刻) |
latencyCompensationTicks |
2 |
为高延迟服务器额外添加到窗口中的刻数 |
predictionStrength |
0.85 |
视觉伤害预测的激进程度 (0.0–1.0) |
rollbackLerpSpeed |
0.3 |
回滚时视觉 HP 恢复的速度 |
pearlPredictionEnabled |
true |
末影珍珠的不同步修复 |
projectilePredictionEnabled |
true |
弓/弩的不同步修复 |
itemUsePredictionEnabled |
true |
食物/药水的不同步修复 |
blockPlacementPredictionEnabled |
true |
方块放置的不同步修复 |
utilityRollbackDelayMs |
400 |
在未确认的实用工具动作回滚前等待的毫秒数 |
debugLogging |
false |
详细的控制台日志 |
debugOverlay |
false |
启用 HUD 调试面板 |
? 高延迟 (150ms+) 推荐设置
{
"hitExpiryTicks": 30,
"latencyCompensationTicks": 5,
"predictionStrength": 0.90,
"utilityRollbackDelayMs": 600
}
? 严格服务器 / 反作弊敏感设置
{
"hitExpiryTicks": 12,
"latencyCompensationTicks": 1,
"predictionStrength": 0.70,
"utilityRollbackDelayMs": 300
}
?️ 反作弊兼容性
此模组从底层设计之初就旨在对反作弊系统不可见。
| 模组行为 |
安全? |
| 在服务器确认前应用视觉血量减少 |
✅ 纯视觉效果 —— 从不触碰实体的真实血量值 |
| 回滚时线性插值视觉血量 |
✅ 仅客户端渲染 |
| 时间戳并跟踪待处理操作 |
✅ 无网络交互 |
| 注入 vanilla 方法 |
✅ 只读,执行后操作 —— 从不取消任何内容 |
| 发送额外的攻击数据包 |
❌ 绝不 —— 这会触发攻击频率限制器 |
| 修改出站数据包时机 |
❌ 绝不 —— 服务端操纵 = 封禁 |
| 更改实体位置 |
❌ 绝不 —— 位置欺骗 = Grim 反作弊直接封禁 |
| 取消传入的服务端数据包 |
❌ 绝不 —— 这会导致客户端不同步 |
兼容:Grim Anticheat、Vulcan、NoCheatPlus、Matrix 以及所有标准服务器反作弊系统。
所有预测逻辑均为纯视觉效果。服务器始终保持权威。
❓ 常见问题
Q: 这个在我没有权限管理的服务器上能用吗?
A: 可以。它是 100% 客户端侧的。不需要安装任何服务端模组或插件。
Q: 这会导致我被封禁吗?
A: 不会。该模组从不发送额外数据包,从不修改出站攻击数据包,也从不改变任何权威的服务端状态。所有更改仅在你自己的客户端上表现为视觉效果。
Q: 它在单人游戏中有效吗?
A: 有效,尽管在 0ms 本地延迟下,幽灵击打本来就不会自然发生 —— 所以你在那里可能看不到太大区别。
Q: 为什么血条有时会在修正前轻微跳动一下?
A: 那是回滚线性插值。当服务器与预测矛盾时,视觉 HP 会平滑地返回到真实值。你可以在配置文件中调整 rollbackLerpSpeed 来使其更快或更慢。
Q: 我可以禁用特定功能吗?
A: 可以。每个功能在 hitregistry.json 中都有自己的开关。你可以仅运行战斗预测、仅运行实用工具预测,或者混合使用。
问:这和 Reach 或 Kill-Aura(自动击杀)模组一样吗?
答:完全不是。此模组不会延长你的攻击距离、自动化攻击,也不会修改击打判定箱(hitboxes)。它仅在你自身操作的基础上,改善视觉反馈和不同步恢复效果。
? 安装
- 为 Minecraft 1.21 安装 Fabric Loader
- 安装 Fabric API
- 将
DiolezHitregistry-1.0.0.jar 放入 .minecraft/mods/ 文件夹
- 启动游戏 —— 首次运行时会自动生成配置文件
⚠️ 已知限制
在网络环境下,实现真正的零延迟 PvP 在物理上是不可能的。以下是我们模拟的内容以及每项限制存在的原因:
-
无敌帧(iFrames): 受到攻击后,实体在服务端会有持续 10 刻的无敌窗口。客户端无法得知其他玩家的精确无敌帧状态,因此在此期间,即使服务端判定有效,本地也可能出现一些被视为“幽灵击中”的情况。
-
弓拉满力度: 拉弓状态由服务端追踪。如果弓未完全拉开,投射物速度预测可能会有轻微偏差。
-
护甲与附魔精度: 伤害估算器仅使用可见属性,并应用了 10% 的保守缩减。实际的服务端伤害(经过护甲韧性、保护附魔计算后)会略有不同,导致服务端响应时出现微小的视觉修正。
-
数据包批处理: 某些服务器配置会对健康同步数据包进行批处理,导致回滚触发延迟额外一两刻。
? 源代码
项目中包含了完整的源代码,其中附带架构文档以及解释每一项设计决策的内联注释。
构建技术栈: Fabric API · Fabric Mixins · Java 21 · Minecraft 1.21 Yarn Mappings
由 Diolez 制作
? DiolezHitregistry — Ghost Hit Elimination & PvP Desync Fix
Feel every swing land. No more ghost hits. No more rubber-band deaths.
Client-side combat prediction for Minecraft 1.21 (Fabric) — zero server-side dependencies.
❓ What Problem Does This Solve?
You've felt it before. You swing on a player, the hit animation plays, particles fly — and nothing happens. Their health doesn't move. You didn't deal damage. The server didn't agree.
That's a ghost hit — caused by the gap between what your client sees and what the server processes. It gets worse the higher your ping is.
DiolezHitregistry eliminates this feeling entirely.
✨ Features
⚔️ Ghost Hit Elimination
Every swing instantly applies a visual health reduction to your target. If the server confirms the hit — perfect, it already looks right. If the server rejects it due to lag or tick desync — the health bar smoothly fades back to the real value. No jarring snap. No confusion.
? Combat Prediction & Reconciliation
The mod timestamps every attack the moment you swing and tracks a live round-trip time estimate from your current ping. It uses this to calibrate a tolerance window — giving the server enough time to respond before deciding a hit was a ghost. On 150ms+ connections, this window automatically widens to absorb lag spikes.
? Utility Desync Fixes
All of these actions are predicted immediately and rolled back gracefully if the server disagrees:
- ? Ender pearls — arc and trajectory appear instantly on throw
- ? Bow & crossbow — projectile predicted on release
- ? Food & potions — consume animation plays without waiting for server
- ? Block placement — block appears in world before server acknowledgement
- ? Hotbar switching — slot change is instant, rolled back if server denies
? Live RTT Calibration
The mod continuously measures your actual ping and uses it to dynamically tune prediction windows — no manual configuration needed. It works well at 20ms and still feels great at 300ms+.
? Debug Overlay (Optional)
Enable a developer HUD that shows in real-time:
- Estimated RTT and tick-boundary crossing risk
- Visual HP vs real HP on your current target
- Prediction status (pending / confirmed / rolled back)
- Entity position error (how far the server-side target is from what you see)
⚙️ Configuration
Config file is auto-created at: .minecraft/config/hitregistry.json
| Option |
Default |
Description |
enabled |
true |
Master on/off toggle |
combatPredictionEnabled |
true |
Toggle hit prediction |
utilityPredictionEnabled |
true |
Toggle utility desync fixes |
hitExpiryTicks |
20 |
How long to wait for server confirmation before treating as ghost hit |
latencyCompensationTicks |
2 |
Extra ticks added to the window for high-ping servers |
predictionStrength |
0.85 |
How aggressively visual damage is predicted (0.0–1.0) |
rollbackLerpSpeed |
0.3 |
How fast visual HP snaps back on rollback |
pearlPredictionEnabled |
true |
Ender pearl desync fix |
projectilePredictionEnabled |
true |
Bow/crossbow desync fix |
itemUsePredictionEnabled |
true |
Food/potion desync fix |
blockPlacementPredictionEnabled |
true |
Block placement desync fix |
utilityRollbackDelayMs |
400 |
ms to wait before rolling back an unconfirmed utility action |
debugLogging |
false |
Verbose console logging |
debugOverlay |
false |
Enable HUD debug panel |
? High Ping (150ms+) Recommended Settings
{
"hitExpiryTicks": 30,
"latencyCompensationTicks": 5,
"predictionStrength": 0.90,
"utilityRollbackDelayMs": 600
}
? Strict Server / Anti-Cheat Sensitive Settings
{
"hitExpiryTicks": 12,
"latencyCompensationTicks": 1,
"predictionStrength": 0.70,
"utilityRollbackDelayMs": 300
}
?️ Anti-Cheat Compatibility
This mod is designed from the ground up to be invisible to anti-cheat systems.
| What this mod does |
Safe? |
| Apply visual health reduction before server confirms |
✅ Purely cosmetic — never touches the entity's real health value |
| Lerp visual health back on rollback |
✅ Client-side rendering only |
| Timestamp and track pending actions |
✅ No network interaction |
| Inject into vanilla methods |
✅ Read-only, post-execution — never cancels anything |
| Send extra attack packets |
❌ Never — would trigger hit-rate limiters |
| Modify outgoing packet timing |
❌ Never — server-side manipulation = ban |
| Alter entity positions |
❌ Never — position spoofing = instant Grim ban |
| Cancel incoming server packets |
❌ Never — would desync the client |
Compatible with: Grim Anticheat, Vulcan, NoCheatPlus, Matrix, and all standard server anti-cheats.
All prediction logic is purely visual. The server always remains authoritative.
❓ FAQ
Q: Does this work on servers I don't own?
A: Yes. It's 100% client-side. No server mod or plugin required.
Q: Will this get me banned?
A: No. The mod never sends extra packets, never modifies outgoing attack packets, and never alters any authoritative server state. All changes are visual-only on your own client.
Q: Does it work in singleplayer?
A: Yes, though at 0ms local latency, ghost hits don't occur naturally — so you won't see much difference there.
Q: Why does the health bar sometimes snap a little before correcting?
A: That's the rollback lerp. When the server contradicts a prediction, the visual HP smoothly returns to the real value. You can adjust rollbackLerpSpeed in the config to make it faster or slower.
Q: Can I disable specific features?
A: Yes. Every feature has its own toggle in hitregistry.json. You can run combat prediction only, utility prediction only, or mix and match.
Q: Is this the same as reach or kill-aura mods?
A: Absolutely not. This mod does not extend your reach, automate attacks, or alter hitboxes. It only improves visual feedback and desync recovery for actions you take yourself.
? Installation
- Install Fabric Loader for Minecraft 1.21
- Install Fabric API
- Drop
DiolezHitregistry-1.0.0.jar into your .minecraft/mods/ folder
- Launch — config is created automatically on first run
⚠️ Known Limitations
True zero-latency PvP is physically impossible over a network. Here's what we simulate and why each limit exists:
-
Invincibility frames (iFrames): After being hit, entities have a server-side 10-tick invincibility window. The client can't know exact iFrame state for other players, so some hits during this window may appear as ghost hits locally even when they're valid server-side.
-
Bow draw power: Draw state is tracked server-side. Projectile velocity prediction may be slightly off if the bow wasn't fully drawn.
-
Armour & enchantment precision: The damage estimator uses visible attributes only and applies a 10% conservative reduction. Actual server damage (post-armour toughness, Protection enchants) will differ slightly, causing a small visual correction when the server responds.
-
Packet batching: Some server configs batch health sync packets, delaying rollback triggers by an extra tick or two.
? Source Code
Full source code with architecture documentation and inline comments explaining every design decision is included in the project.
Built with: Fabric API · Fabric Mixins · Java 21 · Minecraft 1.21 Yarn Mappings
Made by Diolez
评论 0
登录后参与评分
还没有评论,来抢沙发吧