game_end.mcfunction 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. # 小游戏结束
  2. execute if score $mini_type mem matches 1 run function mini:parkour/game_end
  3. execute if score $mini_type mem matches 2 run function mini:tntrun/game_end
  4. execute if score $mini_type mem matches 3 run function mini:hotpm/game_end
  5. execute if score $mini_type mem matches 4 run function mini:colormatch/game_end
  6. execute if score $mini_type mem matches 5 run function mini:zombie/game_end
  7. execute if score $mini_type mem matches 6 run function mini:phantom/game_end
  8. execute if score $mini_type mem matches 7 run function mini:slime/game_end
  9. # 计算排名
  10. tag @a remove mini_rank1
  11. tag @a remove mini_rank2
  12. tag @a remove mini_rank3
  13. tag @a remove mini_rank4
  14. # 1
  15. scoreboard players set #score_max mem -2147483648
  16. execute as @a run function mini:main/get_max_score
  17. execute as @a unless entity @a[tag=mini_rank1] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank1
  18. # 2
  19. scoreboard players set #score_max mem -2147483648
  20. execute as @a[tag=!mini_rank1] run function mini:main/get_max_score
  21. execute as @a[tag=!mini_rank1] unless entity @a[tag=mini_rank2] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank2
  22. # 3
  23. scoreboard players set #score_max mem -2147483648
  24. execute as @a[tag=!mini_rank1,tag=!mini_rank2] run function mini:main/get_max_score
  25. execute as @a[tag=!mini_rank1,tag=!mini_rank2] unless entity @a[tag=mini_rank3] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank3
  26. # 4
  27. tag @a[tag=!mini_rank1,tag=!mini_rank2,tag=!mini_rank3,tag=!watcher] add mini_rank4
  28. # 进入状态 6
  29. function ltw:state/6/state_enter