Procházet zdrojové kódy

使用execute计数

00ll00 před 6 roky
rodič
revize
b4027f71a3

+ 1 - 2
data/mini/functions/main/player_finished.mcfunction

@@ -2,8 +2,7 @@
 
 
 # 计数
 # 计数
 tag @s remove mini_running
 tag @s remove mini_running
-scoreboard players set $t_finish mem 0
-execute as @a[tag=!mini_running] run scoreboard players add $t_finish mem 1
+execute store result score $t_finish mem if entity @a[tag=mini_running]
 execute if score $t_finish mem matches ..3 run tellraw @a [{"selector": "@s","color":"green"}," 已成功! 第 ",{"score": {"name": "$t_finish","objective": "mem"}}," 名!"]
 execute if score $t_finish mem matches ..3 run tellraw @a [{"selector": "@s","color":"green"}," 已成功! 第 ",{"score": {"name": "$t_finish","objective": "mem"}}," 名!"]
 
 
 # 给已完成的玩家加分
 # 给已完成的玩家加分