跳到正文

Indicate

作者:IriDark

显示生物受到的伤害和恢复的生命值

收藏

截图

介绍

介绍由机器翻译自 Modrinth 原页面,仅供参考。

指示

一款信息提示类实用模组,可在生物受到伤害时显示伤害指示器。

showcase.gif


技术文档

无需前置库即可显示通用弹出提示,例如 MISS、CRIT、DODGE,并可出于兼容性考虑添加伤害指示器。

target.getPersistentData().putBoolean("indicate:miss", true);
                
target.getPersistentData().putBoolean("indicate:dodge", true);
                
target.getPersistentData().putBoolean("indicate:crit", true);

伤害指示器的数据文件应存放在 resources/assets/<mod_id>/damage_indicators

{
  // Required: single damage type, #tag, or an array of both:
  // "damage_type": "modid:damage_type",
  // "damage_type": "#modid:damage_type_tag",
  "damage_type": [
    "#minecraft:is_fall",
    "minecraft:fly_into_wall",
    "minecraft:stalagmite"
  ],
  
  // Optional hex colors (# is optional), defaults: "b31111" / "000000"
  "color_hex": "d6c5a3",
  "outline_color_hex": "241e14",
  
  // Optional prefix glyph before the damage number (Example: ☠ 12.5)
  "glyph": "\uE278",
  // Optional font location for the glyph (default: minecraft:default)
  "font": "modid:font_location",
  
  // Optional priority (default: 0). Higher value will override over generic presets (e.g. projectiles use -10)
  "priority": -10
}

API

IndicateAPI.miss(LivingEntity target);

IndicateAPI.dodge(LivingEntity target);

IndicateAPI.popup(LivingEntity target, Component label);

IndicateAPI.popup(LivingEntity target, Component label, int rgb);

IndicateAPI.popup(LivingEntity target, Component label, int rgb, int outlineRgb);

IndicateAPI.popup(LivingEntity target, Component label, Col color);

常见问题

Indicate 支持哪些 Minecraft 版本?

Indicate 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。

Indicate 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分

IriDark 的其他作品

查看全部 →