state_enter.mcfunction 763 B

1234567891011121314151617181920
  1. # 要求系统进入状态 3(主要阶段结束,初始化小游戏)
  2. scoreboard players set $state mem 3
  3. execute as @a run function ltw:state/3/player_enter
  4. # HUD
  5. scoreboard objectives setdisplay sidebar total_score
  6. scoreboard objectives setdisplay list total_score
  7. # 初始化倒计时
  8. scoreboard players set $countdown mem 10
  9. # 小游戏编号
  10. # 1 跑酷;2 TNT Run;3 热土豆
  11. # 优化下一次游戏的选择:生成一个 1~[最大游戏编号] 的 randomarray,每次从其中取下一个数。
  12. execute unless data storage ltw:mini types[0] run function ltw:state/3/newarray
  13. execute store result score $mini_type mem run data get storage ltw:mini types[0]
  14. data remove storage ltw:mini types[0]
  15. # 初始化小游戏
  16. function mini:main/map_init