Kaynağa Gözat

修复金苹果效果buff

HerobrineXia 6 yıl önce
ebeveyn
işleme
40ac5d5a5a

+ 4 - 0
data/item/functions/special/clear_effect.mcfunction

@@ -0,0 +1,4 @@
+effect clear @a[tag=consume_apple] absorption
+effect clear @a[tag=consume_apple] regeneration
+effect clear @a[tag=consume_apple] fire_resistance
+effect give @a[tag=consume_apple] minecraft:resistance 999999 4 true

+ 3 - 5
data/item/functions/special/enchanted_apple.mcfunction

@@ -3,9 +3,7 @@ advancement revoke @s only item:special/consume_enchanted_apple
 
 
 # 计算生命值
 # 计算生命值
 execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run scoreboard players operation @s mini_heart += @s mini_heart
 execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run scoreboard players operation @s mini_heart += @s mini_heart
-
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run function mini:/player_max_health
 # 去除buff
 # 去除buff
-execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run effect clear @s absorption
-execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run effect clear @s fire_resistance
-execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run effect clear @s regeneration
-execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run effect give @s minecraft:resistance 999999 4 true
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run tag @s add consume_apple
+schedule function item:special/clear_effect 1t replace

+ 3 - 2
data/item/functions/special/golden_apple.mcfunction

@@ -3,7 +3,8 @@ advancement revoke @s only item:special/consume_golden_apple
 
 
 # 计算生命值
 # 计算生命值
 execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run scoreboard players add @s mini_heart 1
 execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run scoreboard players add @s mini_heart 1
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run function mini:/player_max_health
 
 
 # 去除buff
 # 去除buff
-execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run effect clear @s absorption
-execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run effect clear @s regeneration
+execute if score $state mem matches 1.. if score @s mini_heart matches 1.. run tag @s add consume_apple
+schedule function item:special/clear_effect 1t replace