
Damage Engine
Display damage information on the UI
- Загрузки
- 3K
- Подписчики
- 14
- Обновлён
- 5 июля 2026 г.
- Лицензия
- MIT
Опубликован 6 февраля 2026 г.
Damage Engine


Damage Engine displays comprehensive combat information on your HUD — total damage, combo counter, damage history, target entity info, floating damage numbers, and a rating system.
Requires installation on both client and server.
HUD Modules
- Total Damage — Accumulated damage in the current combat session, with configurable color thresholds (e.g., white → blue → magenta → gold at different damage milestones).
- Combo Counter — Shows how many hits you've landed in a row (e.g., "x5").
- Progress Bar — A bar that instantly refills on hit and smoothly drains over time, indicating when the combo/damage session will reset.
- Damage History — A scrolling list of recent individual damage values, newest on top, with slide-in and fade-out animations.
- Target Info Panel — Displays the last entity you hit: player avatar head (for players), entity name, HP values, and an animated health bar with damage tail and heal effects.
- Floating Damage Indicators — World-space numbers that pop up from hit targets or projectiles, with distinct animations for normal hits, crits, and kills ("Kill!"). Supports distance-based scaling.
- Rating System — Earn a grade (S / A / B / C / D) based on combo count, normal hits, and crits in each combat session. All scoring weights and grade thresholds are fully configurable.
HUD Editor
Each module can be independently repositioned and resized via a drag-and-drop HUD editor, with undo/redo support.
Configurable Options
- Show/hide each HUD module individually.
- Custom colors for progress bar, combo, history entries, normal/crit damage, health bars, floating indicators, and kill text.
- Configurable color thresholds for total damage (define color tiers at any damage value).
- Adjustable combo reset time, history entry limit (1–50), history display duration, and decimal places (0–10).
- F1 compatibility — optionally hide the HUD when the vanilla GUI is hidden.
- Debug mode — optionally print raw damage info to chat or show current rating score in the action bar.
- Full
config/damage-engine/config.jsonfor manual editing.
Key Bindings
All keys are unbound by default and can be assigned in the controls menu:
- Open Config — Opens the configuration GUI.
- Toggle HUD — Show/hide the entire Damage Engine HUD.
- Clear Damage — Reset the current damage session and clear all floating indicators.
Commands
/damage_engine clear— Clears current damage data (same as the key binding).
Feedback & License
- Issues and suggestions: https://github.com/Ovear-Mitama/Damage-Engine/issues
- Licensed under the MIT license.
Ченджлог
1.3.4.1Релиз1.21, 1.21.1 · 5 июля 2026 г.
- 修复了添加项后双重高亮背景的显示问题
1.3.4Релиз1.21.1 · 4 июля 2026 г.
1.3.4 Damage Engine 1.3.4 for 1.21.1
- [Issue #6]修复Neoforge服务端运行时调用了客户端代码导致崩溃的的bug
- 优化了客户端模式下的伤害追踪逻辑
1.3.3Релиз1.20.1 · 18 июня 2026 г.
[Fabric]Damage Engine 1.3.3 for 1.20.1
- Removed the dependency on Fabric API and the related code.
1.3.2Релиз1.21, 1.21.1 · 9 июня 2026 г.
[Fabric]Damage Engine 1.3.2 for 1.21-1.21.1
新增功能
双端支持(客户端模式)
进入未安装本 mod 的服务端时,自动切换为客户端本地检测模式,无需服务端安装。
LivingEntityClientMixin— 每 tick 监控所有LivingEntity生命值变化,计算伤害量ClientHealthTracker— 客户端本地伤害检测,独立 Java 文件HandshakePayload— C2S 握手包,服务端DamageEngine.java注册接收器,客户端通过ClientPlayNetworking.canSend()判断服务端是否安装- 配置界面左侧分类栏底部红色警告提示
"警告:当前为客户端模式\n伤害归属无法判断\n伤害精度受限" - 客户端模式限制:无法区分攻击者(追踪所有伤害)、无法判断暴击、位置不精确
无圆角边框配置项
infoNoRoundedBorder(默认 false),位于信息外观最上方。关闭时血条和背景使用圆角渲染。
改进
近战命中跳字位置精确化
跳字不再总是从实体重心出现,改为接近命中点。
- 服务端
LivingEntityMixin/PlayerEntityMixin:近战攻击使用MathHelper.clamp将攻击者眼睛位置投影到实体BoundingBox最近点,替代原来的entity.getX/Y/Z() - 客户端
DamageEngineClient.blendIndicatorPos():将服务端位置再向准星命中点混合 35% - 投射物保持原有精确位置不变
血条圆角渲染
DamageHud 新增逐行零重叠圆角绘制方法:
| 方法 | 用途 |
|---|---|
drawRoundedRect |
四角圆角矩形(背景面板) |
drawBarFill |
两端圆角 pill 形状(主血条) |
drawBarSegment |
仅右侧圆角(衰减条/恢复条,左侧平接主血条) |
逐行单次 fill() 零重叠,彻底解决 alpha 叠加导致中间加深的问题。
信息外观排序调整
无圆角边框 → 背景透明度 → 背景颜色 → 血条颜色 → 恢复颜色 → 减少颜色
评分图片区优化
- 已设置图片时,在"选择图片"按钮左侧显示 × 重置按钮(红色,无需确认直接清除)
- 文件名文字整体左移 25px
评分输入框统一宽度
连击分数 / 普通攻击分数 / 暴击分数输入框从 50px → 100px。
跳字参数调整
| 参数 | 旧值 | 新值 |
|---|---|---|
| X 离散 | ±20px (40f) | ±35px (70f) |
| Y 离散 | ±11px (22f) | ±22px (44f) |
| Kill! 初始 Y 偏移 | 0 | +20px |
| 普通上浮速度 | 25f/s | 35f/s |
| Kill! 上浮速度 | 45f/s | 55f/s |
| 基础缩放 | 1.5 | 1.2 |
| 存活时间 | 1.2s | 1.8s |
| 淡入 | 0-15% | 0-12% |
| 淡出 | 80-100% | 78-100% |
信息面板淡出加速
| 参数 | 旧值 | 新值 |
|---|---|---|
淡出时长 INFO_FADE_MS |
1000ms | 500ms |
| 死亡衰减阈值 | 0.25% | 10% |
血条缩到 10% 以下直接开始淡出,不再等最后的慢动画收尾。
Bug 修复
- 击败生物后闪烁
0/1:captureInfoSnapshot在getMaxHealth()返回 0 时保留之前捕获的正确值,不再错误覆盖为 1 - 客户端模式信息面板不切换目标:
ClientHealthTracker现在检测准星传递preferSwitchTarget参数 - 圆角模式 alpha 叠加加深:重写为逐行零重叠绘制
1.3.1Релиз1.21, 1.21.1 · 8 июня 2026 г.
[Fabric]Damage Engine 1.3.1 for 1.21-1.21.1
新增:自定义评价等级图片
现在可以为每个评价等级(S/A/B/C/D)设置自定义 PNG 图片来替代文字显示。
使用方法
- 打开模组配置 → 评价外观
- 启用 "使用图片显示评价"
- 点击每个等级旁的 "选择图片" 按钮,选择本地 PNG 图片
- 保存并退出,评价等级将以图片形式显示
图片会自动存到
config/damage-engine/images/
├── rating_1.png (等级1 - 最高)
├── rating_2.png
├── rating_3.png
├── rating_4.png
└── rating_5.png (等级5 - 最低)
- 支持任意尺寸的 PNG 图片,会自动缩放
- 不需要资源包,即选即用
1.3.0Релиз1.21, 1.21.1 · 8 июня 2026 г.
[Fabric]Damage Engine 1.3.0 for 1.21-1.21.1
一、伤害跳字功能(新功能)
1. World-to-HUD 跳字系统
- 新增
src/client/java/damage/engine/hud/DamageIndicator.java - 基于 JOML 手动构建 World→HUD 投影矩阵,不依赖 RenderSystem
- 近战攻击:跳字从目标实体位置跳出
- 投掷物攻击(箭、火球等):跳字从投射物位置跳出
- 爆炸伤害(水晶、TNT 等):跳字从目标实体位置跳出
- 通过
WorldRenderEvents.AFTER_TRANSLUCENT捕获投影矩阵兼容放大 mod
2. 平滑动画
- 普通/暴击:从小变大→保持→缩小淡出,全程上浮
- Kill!:大→小冲击感动画
- 随机偏移 X±25px Y±12.5px,基础倍率 1.5x
3. 距离缩放
distScale = 8.0 / max(w, 8.0),范围 0.4~1.0
4. 性能
- 最多 60 个跳字,500ms 批量清理,屏幕外剔除,synchronized 线程安全
二、评价系统(新功能)
新增文件
src/client/java/damage/engine/hud/RatingManager.java
评分公式(3项加分累计,无上限)
| 因子 | 计算方式 | 默认值 |
|---|---|---|
| 连击分数 | 连击次数 × 分数 | 0.2 |
| 普通攻击分数 | 普通命中数 × 分数 | 6 |
| 暴击分数 | 暴击次数 × 分数 | 10 |
评分重置
ratingResetTime默认 10s,超时未攻击自动结束评分
默认等级
| S ≥1000 | A ≥500 | B ≥250 | C ≥100 | D ≥20 |
显示
- 独立模块可拖拽调整位置
- 连击期间实时更新,结束 2.5s 淡出
- 预览每 1.5s 轮放等级
三、Bug 修复汇总
- 水晶爆炸跳字位置 →
instanceof ProjectileEntity判断 - 重置后欢迎语 →
hasShownWelcomeMessage不再重置 - 音效过大 → 音量 0.08F
- 历史动画方向 →
isNewEntry判断修正 - 跳字消失 → 仅捕获 projection,自行构建 view
- 调试日志 → init() 中全部删除
- 翻译重复 → decimalPlaces 去重
- damage 标签褪色不同步 → 统一使用 baseAlpha
1.2.3Релиз1.21, 1.21.1 · 26 апреля 2026 г.
[Fabric]Damage Engine 1.2.3 for 1.21-1.21.1
- Fixed the issue of sound effects being too loud
- Removed the command /damage_engine options
1.2.2Релиз1.21.11 · 11 апреля 2026 г.
[Fabric]Damage Engine 1.2.2 for 1.21.11
- Please go to the Damage Engine 1.2.1 for 1.21-1.21.1 changelog
- 1.2.2 Fixed the issue where the fatal time information started displaying from 0
Комментарии
Загружаем…