2
0

player_failed.mcfunction 607 B

12345678910111213141516171819
  1. # 玩家失败时由玩家自己触发
  2. # 计数
  3. tag @s remove mini_running
  4. function mini:main/update_player_count
  5. # 显示提示
  6. execute if entity @s[tag=!rejoining] if score $player_alive mem matches 1.. run tellraw @a [{"selector": "@s","color":"red"}," 已失败! 剩余 ",{"score": {"name": "$player_alive","objective": "mem"}}," 人!"]
  7. execute as @a at @s run function lib:sounds/error
  8. # 给存活的玩家加分
  9. scoreboard players add @a[tag=mini_running] mini_score 1
  10. # 进入旁观
  11. gamemode spectator @s
  12. spectate @r[tag=mini_running]
  13. # 检查游戏是否结束
  14. function mini:main/check_game_end