player_enter_watcher.mcfunction 1.1 KB

123456789101112131415161718192021222324
  1. # 作为旁观者加入服务器
  2. team join watching @s
  3. # 清除名次
  4. tag @s remove mini_rank1
  5. tag @s remove mini_rank2
  6. tag @s remove mini_rank3
  7. tag @s remove mini_rank4
  8. # 清除得分显示(防止中途加入的旁观者依然保留上一局的得分)
  9. scoreboard players reset @s total_score
  10. scoreboard players reset @s total_score_disp
  11. # 重新加入阶段
  12. tag @s add rejoining
  13. execute if score $state mem matches 3 run function ltw:state/3/player_enter
  14. execute if score $state mem matches 4 run function ltw:state/4/player_enter
  15. execute if score $state mem matches 5 run function ltw:state/5/player_enter
  16. execute if score $state mem matches 6 run function ltw:state/6/player_enter
  17. execute if score $state mem matches 7 run function ltw:state/7/player_enter
  18. tag @s remove rejoining
  19. # 显示轮数提醒
  20. execute unless score $state mem matches 0 run tellraw @s ["",{"text":">> ","color":"aqua","bold":true},"你目前正在旁观中, 游戏进行至第 ",{"score": {"name": "$round","objective": "mem"},"color": "aqua"}, {"text":"/5","color": "aqua"}," 轮, 游戏结束后就能加入啦!"]