player_finished.mcfunction 636 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_finish mem matches ..3 run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 已完成! 获得了第 ",{"score": {"name": "$player_finish","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