tick1.mcfunction 2.5 KB

123456789101112131415161718
  1. # 如果需要对玩家启用 TNT Run 模块,则给予其 tntrun_pc 标签
  2. tag @a add tntrun_pc
  3. # 以下为检测并控制方块消失的命令
  4. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~ ~-1 ~ align xyz if block ~ ~ ~ mini:tntrun_floor positioned ~0.5 ~ ~0.5 run tag @e[tag=tntrun_edge,distance=..0.1] remove tntrun_edge
  5. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~ ~-1 ~ align xyz if block ~ ~ ~ mini:tntrun_floor positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_as"],Age: -2147483648, Duration: -1, WaitTime: -2147483648,}
  6. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~0.31 ~-1 ~0.31 align xyz if block ~ ~ ~ mini:tntrun_floor positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Age: -2147483648, Duration: -1, WaitTime: -2147483648,}
  7. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~-0.31 ~-1 ~-0.31 align xyz if block ~ ~ ~ mini:tntrun_floor positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Age: -2147483648, Duration: -1, WaitTime: -2147483648,}
  8. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~0.31 ~-1 ~-0.31 align xyz if block ~ ~ ~ mini:tntrun_floor positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Age: -2147483648, Duration: -1, WaitTime: -2147483648,}
  9. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~-0.31 ~-1 ~0.31 align xyz if block ~ ~ ~ mini:tntrun_floor positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Age: -2147483648, Duration: -1, WaitTime: -2147483648,}
  10. execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~ ~-1 ~ align xyz if block ~ ~ ~ minecraft:air positioned ~0.5 ~ ~0.5 run tag @e[tag=tntrun_edge,distance=..1.51] remove tntrun_edge
  11. scoreboard players add @e[tag=tntrun_as] tntrun_timer 1
  12. # 修改下面这一行的数字以调整方块消失的延迟(刻)
  13. # tntrun_timer=12
  14. execute as @e[tag=tntrun_as,scores={tntrun_timer=12}] at @s run setblock ~ ~ ~ air
  15. execute as @e[tag=tntrun_as] at @s unless block ~ ~ ~ mini:tntrun_floor run kill @s
  16. execute as @e[tag=tntrun_edge] at @s unless entity @a[tag=tntrun_pc,distance=..1.51] run kill @s