tick2.mcfunction 1.5 KB

12345678910111213141516171819202122232425262728
  1. # 每秒执行一次
  2. schedule function ltw:clock/tick2 2t replace
  3. # 调用其他模块
  4. function lib:bossbar/tick2
  5. execute if score $state mem matches 3 run function ltw:state/3/tick2
  6. execute if score $state mem matches 4 run function ltw:state/4/tick2
  7. execute if score $state mem matches 5 run function ltw:state/5/tick2
  8. execute if score $state mem matches 6 run function ltw:state/6/tick2
  9. execute if score $state mem matches 7 run function ltw:state/7/tick2
  10. # 调用节奏方块模块
  11. execute if score $tempo_enable mem matches 1 run function lib:tempo_block/tick2
  12. # 调用物品模块(必须最后调用)
  13. function item:tick2
  14. # 全局倒计时
  15. execute if score $countdown_fast mem matches 1.. run scoreboard players remove $countdown_fast mem 1
  16. scoreboard players remove @e[scores={countdown_fast=1..}] countdown_fast 1
  17. # 特殊方块给予效果
  18. execute as @a[gamemode=!spectator] if score @s effect_floating matches 1.. run scoreboard players add @s effect_floating 1
  19. execute as @a[gamemode=!spectator] if score @s effect_floating matches 6.. run effect clear @s levitation
  20. execute as @a[gamemode=!spectator] if score @s effect_floating matches 6.. run scoreboard players set @s effect_floating 0
  21. execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 1
  22. execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12 true
  23. execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true