Skip to content

MythicMobs 集成

EmakiAttribute 与 MythicMobs 深度集成,提供属性伤害技能机制、属性条件判断和怪物属性配置。

NOTE

MythicMobs 为软依赖,未安装时相关功能静默跳过。

技能机制:emaki_damage

注册名:emaki_damage(别名:emakiattribute_damageattribute_damage

在 MythicMobs 技能中使用属性伤害系统对目标造成伤害。

参数类型默认值说明
damagedoubleskill power基础伤害值。
damage_typestring伤害类型 ID(如 physicalspell)。
allow_criticalbooleantrue是否允许暴击判定。
allow_target_dodgebooleanfalse是否允许目标闪避。
calculate_target_defensebooleantrue是否计算目标防御。
trigger_mythic_on_damagedbooleanfalse是否触发 MythicMobs 的 on_damaged 事件。

使用示例

yaml
# MythicMobs 技能配置
FireBlast:
  Skills:
    - emaki_damage{damage=50;damage_type=spell;allow_critical=true} @target

技能机制:临时属性

以下机制作用于技能目标(@target@self 等),对玩家和怪物均生效。临时属性到期后自动移除;不持久化,服务器重启即失效。

升级须知:限时属性行为变化

  1. emaki_attribute_add_tag 的复合效果 ID 已消失。 过去 effect_prefix=poison 会为每个命中属性各写一条 poison:属性id 的独立记录,现在全部归入 poison 一个效果组。按复合 ID 精确删除的旧配置会失效,改用 emaki_attribute_remove{effect_id=poison};而过去删不掉东西的这条写法现在才真正生效。
  2. 多个效果组对同一属性 SET(set=true)时的胜者已确定为最后写入的那一条,不再依赖内部哈希表迭代顺序。

单属性技能配置不受影响,行为逐字不变。另:底层拒绝(未注册属性、非法 stack_modeNaN)过去仍返回 SUCCESS,现在返回 INVALID_CONFIG 并在控制台输出告警。

emaki_attribute_add

注册名:emaki_attribute_add(别名:emakiattribute_add

给目标添加一个临时属性。

参数类型默认值说明
effect_idstring效果组 ID。同一个 ID 下可放多个属性,互不覆盖、能被 emaki_attribute_remove 整组清掉;同 ID 同属性重复施加时才按叠加模式处理。别名:effectidid
attributestring属性 ID。未注册时返回 INVALID_CONFIG 并输出告警。别名:attribute_idattributeid
valuedouble0临时属性数值。NaN / ±Inf 返回 INVALID_CONFIG。别名:amountv
durationint持续时间(tick),必须大于 0。别名:duration_ticksticksd
stack_modestring属性默认叠加模式 REPLACE / STACK。留空则使用属性定义的 temporary_stack_mode;写成其它值返回 INVALID_CONFIG 而不再静默回落。别名:stackmodemode
setbooleanfalsetrue 时使用覆盖式赋值(SET)而非叠加式(ADD)。别名:override_value

目标不是生物实体(LivingEntity)时返回 INVALID_TARGET

emaki_attribute_remove

注册名:emaki_attribute_remove(别名:emakiattribute_remove

清除目标身上指定 effect_id 效果组内的全部临时属性。

参数类型说明
effect_idstring要清理的效果组 ID;该组内全部属性一起移除。目标没有该组时返回 CONDITION_FAILED,目标不是生物实体时返回 INVALID_TARGET。别名:effectidid

emaki_attribute_add_tag

注册名:emaki_attribute_add_tag(别名:emakiattribute_add_tag

给目标添加所有带指定标签的临时属性。会遍历所有 tags 含该标签的属性,并把它们全部归入同一个效果组,因此可以用 emaki_attribute_remove 传该组 ID 一次清掉整套。

参数类型默认值说明
tagstring属性标签(如 DEBUFF),不区分大小写。别名:tagst
valuedouble0统一施加给每个属性的数值。别名:amountv
durationint持续时间(tick),必须大于 0。别名:duration_ticksticksd
effect_prefixstringtag:<tag>整套属性归入的效果组 ID。别名:effectprefixprefix
stack_modestring各属性默认叠加模式 REPLACE / STACK。留空则各属性使用自身的 temporary_stack_mode;写成其它值返回 INVALID_CONFIG。别名:stackmodemode

目标不是生物实体时返回 INVALID_TARGET

emaki_attribute_clear_tag

注册名:emaki_attribute_clear_tag(别名:emakiattribute_clear_tag

清除目标身上所有「属性带指定标签」的临时属性。

参数类型说明
tagstring属性标签,不区分大小写。别名:tagst。目标不是生物实体时返回 INVALID_TARGET

使用示例

yaml
# 命中目标附加 5 秒减速 debuff,并统一施加所有 DEBUFF 标签属性
CurseStrike:
  Skills:
    - emaki_attribute_add{effect_id=curse_slow;attribute=movement_speed;value=-2;duration=100} @target
    - emaki_attribute_add_tag{tag=DEBUFF;value=-10;duration=100;stack_mode=STACK} @target
# 净化:清除目标所有 DEBUFF 临时属性
Purify:
  Skills:
    - emaki_attribute_clear_tag{tag=DEBUFF} @target

条件:emaki_attribute

注册名:emaki_attribute(别名:emakiattribute_attributeattribute_valueattribute_resource

检查实体的属性值或资源值。

参数类型说明
attributestring属性 ID(检查属性值时使用)。
resourcestring资源 ID(检查资源值时使用)。仅对玩家生效。
fieldstring资源字段:current(别名 current_valuevalue)、max(别名 current_max)、default(别名 default_max)、bonus(别名 bonus_max)、percent。默认 current
operatorstring比较运算符。
valuedouble比较值。
value_2doublebetween 运算符时的第二个值。

运算符

运算符别名说明
>gt大于。
>=gte大于等于(默认值)。
<lt小于。
<=lte小于等于。
!=<>ne不等于。
between在 value 和 value_2 之间(含端点,自动按大小排序)。

NOTE

不填 operator 或填写无法识别的运算符时,都按 >= 处理。没有独立的等于运算符。

使用示例

yaml
# 当目标生命低于 30% 时触发
Conditions:
  - emaki_attribute{resource=health;field=percent;operator=<;value=30} true

怪物属性配置

在 MythicMobs 怪物配置文件中,通过 EmakiAttribute 节为怪物设置属性:

yaml
# MythicMobs 怪物配置
FireDragon:
  Type: ENDER_DRAGON
  Health: 500
  EmakiAttribute:
    - "physical_attack: 100"
    - "physical_defense: 50"
    - "spell_attack: 80"
    - "health: 500"

每一行必须加引号

EmakiAttribute 是字符串列表。写成 - physical_attack: 100(不加引号)时,YAML 会把它解析成映射而不是字符串,该节会被整段跳过,怪物拿不到任何属性,且不会有任何报错或警告。

判断方式:进战斗后开 /ea debug on,看攻击者快照里有没有你配的属性 ID。只有 default_profile 的默认项说明这一节没被读到。

  • 属性值支持数学表达式(通过 ExpressionEngine 解析)。
  • 怪物生成时自动同步属性。
  • MythicMobs 重载后自动 resync 所有活跃怪物。

生命周期同步

事件行为
MythicMobSpawnEvent怪物生成时读取 EmakiAttribute 节并同步属性。
MythicPostReloadedEventMythicMobs 重载后自动 resync 所有活跃的 MythicMobs 怪物。