fz-survival-datapack/data/fz/functions/game_event/player/on_took_damage.mcfunction

9 lines
515 B
Mcfunction

## 调试
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "受到了伤害"}]
## 将事件数据缓存
scoreboard players operation fz.var.score fz.variable.integer = @s fz.event.damage_taken
scoreboard players operation fz.var.score fz.variable.integer /= 10 fz.variable.integer
## 运行事件
function #fz:game_event/player/on_took_damage