player_failed.mcfunction 552 B

1234567891011121314151617
  1. # 玩家失败时由玩家自己触发
  2. # 失败提示与计数
  3. tag @s remove mini_running
  4. scoreboard players set $t_alive mem 0
  5. execute as @a[tag=mini_running] run scoreboard players add $t_alive mem 1
  6. tellraw @a [{"selector": "@s","color":"red"}," 已失败! 剩余 ",{"score": {"name": "$alive","objective": "mem"}}," 人!"]
  7. # 记录名次
  8. # UNDONE
  9. # 进入旁观
  10. gamemode spectator @s
  11. spectate @r[tag=mini_running]
  12. # 如果只有一个玩家没有失败,则游戏结束
  13. execute if score $t_alive mem matches ..1 run function mini:main/game_end