tick5.mcfunction 1011 B

123456789101112131415161718
  1. # 触发单个模块
  2. execute if score $mini_type mem matches 1 run function mini:parkour/tick5
  3. execute if score $mini_type mem matches 2 run function mini:tntrun/tick5
  4. execute if score $mini_type mem matches 3 run function mini:hotpm/tick5
  5. execute if score $mini_type mem matches 5 run function mini:phantom/tick5
  6. # 特殊方块给予效果
  7. execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 5 true
  8. execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
  9. # 同步生命值
  10. scoreboard players reset * temp
  11. scoreboard players set @a[gamemode=!spectator] temp 20
  12. execute as @a[gamemode=!spectator,scores={health=1..}] run scoreboard players operation @s temp = @s health
  13. execute as @a run scoreboard players operation @s health_disp = @s temp
  14. execute as @a run scoreboard players operation @s mini_heart_disp = @s mini_heart
  15. execute as @a run scoreboard players operation @s mini_heart_disp += @s mini_heart