tick5.mcfunction 1.1 KB

123456789101112131415161718
  1. # 每 0.25s 执行一次
  2. schedule function ltw:clock/tick5 5t replace
  3. # 调用其他模块
  4. execute if score $state mem matches 0 run function ltw:state/0/tick5
  5. execute if score $state mem matches 5 run function ltw:state/5/tick5
  6. function ltw:main/tick5
  7. # 死亡触发
  8. execute as @a[scores={death=1..,health=1..}] at @s run function ltw:main/player_death
  9. # 特殊方块给予效果
  10. execute as @a[gamemode=!spectator] if score @s effect_floating matches 1.. run scoreboard players add @s effect_floating 1
  11. execute as @a[gamemode=!spectator] if score @s effect_floating matches 3.. run effect clear @s levitation
  12. execute as @a[gamemode=!spectator] if score @s effect_floating matches 3.. run scoreboard players set @s effect_floating 0
  13. execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 1
  14. execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12 true
  15. execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true