player_finished.mcfunction 617 B

1234567891011121314151617
  1. # 玩家成功时由玩家自己触发
  2. # 成功提示与计数
  3. tag @s remove mini_running
  4. scoreboard players set $t_finish mem 0
  5. execute as @a[tag=!mini_running] run scoreboard players add $t_finish mem 1
  6. tellraw @a [{"selector": "@s","color":"green"}," 已成功! 已完成 ",{"score": {"name": "$finish","objective": "mem"}}," 人!"]
  7. # 给已完成的玩家加分
  8. scoreboard players add @a[tag=!mini_running] mini_score 1
  9. # 进入旁观
  10. gamemode spectator @s
  11. spectate @r[tag=mini_running]
  12. # 如果有三个玩家成功,则游戏结束
  13. execute if score $t_finish mem matches 3.. run function mini:main/game_end