state_enter.mcfunction 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # 在系统进入状态时触发
  2. scoreboard players set $state mem 0
  3. # HUD
  4. scoreboard objectives setdisplay belowName
  5. scoreboard objectives setdisplay sidebar
  6. scoreboard objectives setdisplay list
  7. # 区域
  8. forceload remove all
  9. forceload add 0 0
  10. forceload add 31 -17 -31 -80
  11. # 规则
  12. function ltw:init/gamerule
  13. gamerule naturalRegeneration true
  14. # 队伍
  15. team remove hub_watch
  16. team add hub_watch "旁观"
  17. team modify hub_watch collisionRule never
  18. team modify hub_watch prefix {"text":" ◇ ","color":"white"}
  19. team modify hub_watch suffix " "
  20. team remove hub_play
  21. team add hub_play "准备"
  22. team modify hub_play collisionRule never
  23. team modify hub_play prefix {"text":" ◆ ","color":"green"}
  24. team modify hub_play suffix " "
  25. # 实体
  26. function ltw:init/entity
  27. function ltw:state/0/sp/refresh_entity
  28. # 玩家
  29. execute as @a[team=!debug] run function ltw:state/0/player_enter
  30. # ——————————————————————————————————————————————
  31. # 重置开始倒计时
  32. scoreboard players set $start_countdown mem 9999999
  33. # 初始化节奏方块
  34. function ltw:state/0/sp/tempo_block/marker_spawn
  35. # TODO: 未完成的重构
  36. # bossbar
  37. #scoreboard players set $bossbar_type mem 0
  38. #function lib:bossbar/show