player_leave.mcfunction 479 B

1234567
  1. # 任意玩家下线时触发
  2. execute store result score $t_count mem if entity @a[tag=!watcher]
  3. execute if score $state mem matches 1.. if score $game_type mem matches 1 if score $t_count mem matches ..2 run function ltw:main/game_end
  4. execute if score $state mem matches 1.. if score $game_type mem matches 1 if score $t_count mem matches ..2 run tellraw @a {"text": "由于玩家人数不足, 游戏直接结束!","color":"red"}
  5. # TODO 小游戏结束逻辑可能导致卡住