special_block.mcfunction 1.1 KB

123456789101112131415
  1. # 5tick运行一次 计分板单位5tick
  2. # 钻石:起飞
  3. scoreboard players remove @a[scores={effect_floating=0..}] effect_floating 1
  4. execute as @a[gamemode=!spectator,scores={effect_floating=..0}] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12
  5. execute as @a[gamemode=!spectator,scores={effect_floating=..0}] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
  6. execute as @a[gamemode=!spectator,scores={effect_floating=..0}] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 2
  7. execute as @a[gamemode=!spectator,scores={effect_floating=..0}] at @s if block ~ ~-1 ~ diamond_block run function lib:sounds/teleport
  8. effect clear @a[scores={effect_floating=0}] levitation
  9. # 绿宝石:回血
  10. scoreboard players remove @a[scores={effect_regen=0..}] effect_regen 1
  11. execute as @a[gamemode=!spectator,scores={effect_regen=..0}] at @s if block ~ ~-1 ~ emerald_block run effect give @s regeneration 2 2
  12. execute as @a[gamemode=!spectator,scores={effect_regen=..0}] at @s if block ~ ~-1 ~ emerald_block run scoreboard players set @s effect_regen 4
  13. effect clear @a[scores={effect_regen=0}] regeneration