Indicate

模组

· 作者 IriDark

指示对实体造成的伤害和治疗

0 本站下载 0 关注 更新于 3 小时前

最新 1.21.1-1.1 · 1.21.1 · NeoForge

一键开服(送7天)

Indicate

一款信息化工具模组,为 Minecraft 添加伤害指示器。当任何生物受到伤害时,指示器便会弹出显示。

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 目录下。

{
  // 必填:单一伤害类型、标签或两者的数组:
  // "damage_type": "modid:damage_type",
  // "damage_type": "#modid:damage_type_tag",
  "damage_type": [
    "#minecraft:is_fall",
    "minecraft:fly_into_wall",
    "minecraft:stalagmite"
  ],
  
  // 可选的十六进制颜色(# 符号可选),默认值:"b31111" / "000000"
  "color_hex": "d6c5a3",
  "outline_color_hex": "241e14",
  
  // 伤害数值前可选的前缀字形字符(例如:☠ 12.5)
  "glyph": "\uE278",
  // 字形可选的字体位置(默认:minecraft:default)
  "font": "modid:font_location",
  
  // 可选优先级(默认:0)。数值越高将覆盖通用预设(例如投射物使用 -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);

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源