HerobrineXia 6 лет назад
Родитель
Сommit
e1aad698b3

+ 3 - 0
data/mini/functions/phantom/game/use_trident.mcfunction

@@ -0,0 +1,3 @@
+# 设置玩家分数
+scoreboard players set @s countdown 2
+scoreboard players reset @s useTrident

+ 4 - 0
data/mini/functions/phantom/player_enter.mcfunction

@@ -9,6 +9,10 @@ effect give @s saturation 1000000 0 true
 effect give @s instant_health 10 0 true
 gamerule naturalRegeneration false
 
+# 计分板重置
+scoreboard players reset @s useTrident
+scoreboard players reset @s countdown
+
 # 传送玩家
 tp @s[tag=!debug] 1030.5 24.5 6031.5
 

+ 4 - 3
data/mini/functions/phantom/tick2.mcfunction

@@ -1,7 +1,8 @@
-# 给与玩家三叉戟
+# 使用三叉戟调用函数
+execute as @a[tag=mini_running] if score @s useTrident matches 1.. run function mini:phantom/game/use_trident
+
+# 给予三叉戟
 execute as @a[tag=mini_running] unless data entity @s Inventory[{id:"minecraft:trident",tag:{GameItem:1b}}] unless score @s countdown matches 1.. run function mini:phantom/game/give_trident
-execute as @a[tag=mini_running] if score @s useTrident matches 1 run scoreboard players set @s countdown 2
-execute as @a[tag=mini_running] if score @s useTrident matches 1 run scoreboard players reset @s useTrident
 
 # 清理错位的三叉戟
 execute as @a[tag=mini_running] unless score @s countdown matches 1.. unless data entity @s Inventory[{id:"minecraft:trident",Slot:8b,tag:{GameItem:1b}}] if data entity @s Inventory[{id:"minecraft:trident",tag:{GameItem:1b}}] run function mini:phantom/game/give_trident