2
0

tick20.mcfunction 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. # 120s:时间提示
  7. execute if score $countdown mem matches 120 run title @a subtitle {"text":"⚠ 还剩两分钟! ⚠","color":"yellow"}
  8. execute if score $countdown mem matches 120 run title @a times 1 50 3
  9. execute if score $countdown mem matches 120 run title @a title ""
  10. # 90s:雷达提示
  11. execute if score $countdown mem matches 90 run title @a subtitle {"text":"⚠ 玩家雷达将在三十秒后开启! ⚠","color":"yellow"}
  12. execute if score $countdown mem matches 90 run title @a times 1 100 3
  13. execute if score $countdown mem matches 90 run title @a title ""
  14. execute if score $countdown mem matches 90 run scoreboard players set $bossbar_color mem 2
  15. execute if score $countdown mem matches 90 run function lib:bossbar/show
  16. # 60s:雷达开启
  17. execute if score $countdown mem matches 61 as @a run function lib:sounds/music/mini_fast
  18. execute if score $countdown mem matches 60 run title @a subtitle {"text":"⚠ 玩家雷达已开启!还剩一分钟! ⚠","color":"red"}
  19. execute if score $countdown mem matches 60 run title @a times 1 120 3
  20. execute if score $countdown mem matches 60 run title @a title ""
  21. execute if score $countdown mem matches 60 run scoreboard players set $bossbar_color mem 1
  22. execute if score $countdown mem matches 60 run function lib:bossbar/show
  23. execute if score $countdown mem matches 60 run playsound minecraft:entity.ender_dragon.growl player @a 0 1000000 0 1000000 1.5
  24. # 30s:时间提示
  25. execute if score $countdown mem matches 30 run title @a subtitle {"text":"⚠ 还剩三十秒! ⚠","color":"yellow"}
  26. execute if score $countdown mem matches 30 run title @a times 1 50 3
  27. execute if score $countdown mem matches 30 run title @a title ""
  28. # 0s:游戏结束
  29. execute if score $countdown mem matches 0 run function mini:main/game_end
  30. # 回复生命值
  31. execute if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
  32. execute if score $foursec mem matches 1 run schedule function mini:iron/game/clear_effect 1t replace
  33. # 给予进度
  34. advancement grant @a[team=playing,scores={iron_count=10..}] only ltw:blood/iron1
  35. advancement grant @a[team=playing,scores={iron_count=20..}] only ltw:blood/iron2
  36. advancement grant @a[team=playing,scores={iron_count=30..}] only ltw:blood/iron3
  37. advancement grant @a[team=playing,scores={iron_count=45..}] only ltw:blood/iron4