tick1.mcfunction 2.5 KB

123456789101112131415
  1. # 以下为检测并控制方块消失的命令
  2. 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
  3. 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_block,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_block"],Age: -2147483648, Duration: -1, WaitTime: -2147483648}
  4. 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_block,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_block","tntrun_edge"],Age: -2147483648, Duration: -1, WaitTime: -2147483648}
  5. 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_block,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_block","tntrun_edge"],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_block,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_block","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_block,distance=..0.1] run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["tntrun_block","tntrun_edge"],Age: -2147483648, Duration: -1, WaitTime: -2147483648}
  8. 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
  9. # 修改下面这一行的数字以调整方块消失的延迟(刻)
  10. # tntrun_timer=12
  11. execute as @e[tag=tntrun_block,scores={tntrun_timer=12}] at @s run setblock ~ ~ ~ air
  12. scoreboard players add @e[tag=tntrun_block] tntrun_timer 1
  13. execute as @e[tag=tntrun_block] at @s unless block ~ ~ ~ #mini:tntrun_floor run kill @s
  14. execute as @e[tag=tntrun_edge] at @s unless entity @a[tag=tntrun_pc,distance=..1.51] run kill @s