player_failed.mcfunction 619 B

123456789101112131415161718
  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 ["",{"text": ">> ","color":"red","bold":true},{"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
  12. # 检查游戏是否结束
  13. function mini:main/check_game_end