player_lose_heart.mcfunction 360 B

123456789
  1. # 玩家失去一条命时调用此函数
  2. # 减少命
  3. execute if score @s mini_heart matches 1.. run scoreboard players remove @s mini_heart 1
  4. # 计算血量
  5. function mini:main/player_max_health
  6. # 修改血量
  7. effect give @s minecraft:instant_health 1 0
  8. # 生命值归0判定失败
  9. execute if score @s mini_heart matches 0 run function mini:main/player_failed