enchanted_apple.mcfunction 933 B

12345678910111213141516
  1. # 去除进度
  2. advancement revoke @s only item:special/consume_enchanted_apple
  3. # 计算生命值
  4. execute if score @s mini_heart matches 1.. run scoreboard players operation @s mini_heart += @s mini_heart
  5. execute if score @s mini_heart matches 1.. run function mini:main/player_max_health
  6. execute if score @s mini_heart matches 1.. run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 食用了附魔金苹果, 生命加倍!"]
  7. # 无生命计数:恢复生命
  8. execute unless score @s mini_heart matches 1.. run effect give @s instant_health 1 1 true
  9. execute unless score @s mini_heart matches 1.. run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 食用了附魔金苹果!"]
  10. # $remove_resistance 信息在小游戏初始化时提供
  11. # 去除buff
  12. tag @s add consume_apple
  13. schedule function item:special/clear_apple_effect 2t replace