tick20.mcfunction 1.7 KB

1234567891011121314151617181920212223242526
  1. # 显示倒计时
  2. execute if score $countdown mem matches ..10 run title @a times 3 14 2
  3. execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
  4. execute if score $countdown mem matches ..10 run title @a title [""]
  5. execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
  6. # 170s:关闭循环播放
  7. execute if score $countdown mem matches 170 run scoreboard players set @a music_time 999
  8. # 90s / 60s:雷达提示
  9. execute if score $countdown mem matches 90 run tellraw @a ["",{"text": ">> ","color": "gold","bold": true},{"text":"玩家雷达将在 ","color": "gold"}, "30 秒 ",{"text": "后开启","color": "gold"}]
  10. execute if score $countdown mem matches 90 run scoreboard players set $bossbar_color mem 2
  11. execute if score $countdown mem matches 90 run function lib:bossbar/show
  12. execute if score $countdown mem matches 61 as @a run function lib:sounds/music/mini_fast
  13. execute if score $countdown mem matches 60 run tellraw @a ["",{"text": ">> ","color": "gold","bold": true},{"text": "玩家雷达已开启, 游戏将在 ","color": "gold"},"60 秒 ", {"text": "后结束","color": "gold"}]
  14. execute if score $countdown mem matches 60 run scoreboard players set $bossbar_color mem 1
  15. execute if score $countdown mem matches 60 run scoreboard objectives setdisplay belowName diamond
  16. execute if score $countdown mem matches 60 run function lib:bossbar/show
  17. # 0s:游戏结束
  18. execute if score $countdown mem matches 0 run function mini:main/game_end
  19. # 回复生命值
  20. execute if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
  21. execute if score $foursec mem matches 1 run schedule function mini:diamond/game/clear_effect 1t replace