Просмотр исходного кода

添加注释,将 init 也分散到小游戏的子文件夹

LTCatt 6 лет назад
Родитель
Сommit
e34a1afccc

+ 1 - 1
data/mini/functions/init.mcfunction

@@ -1 +1 @@
-scoreboard objectives add tntrun_timer dummy ["TNT Run 方块消失计时"]
+function mini:tntrun/init

+ 1 - 0
data/mini/functions/tntrun/init.mcfunction

@@ -0,0 +1 @@
+scoreboard objectives add tntrun_timer dummy ["TNT Run 方块消失计时"]

+ 0 - 1
data/mini/functions/tntrun/test.mcfunction

@@ -1 +0,0 @@
-execute as @s run say 233!

+ 4 - 5
data/mini/functions/tntrun/tick.mcfunction

@@ -1,17 +1,16 @@
-#tag @a remove tntrun_pc
+# 如果需要对玩家启用 TNT Run 模块,则给予其 tntrun_pc 标签
 tag @a add tntrun_pc
-#[x=401,y=3,z=-250,dx=20,dz=30,dy=29]
 
+# 以下为检测并控制方块消失的命令
 execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~ ~-1 ~ align xyz if block ~ ~ ~ minecraft:cyan_terracotta positioned ~0.5 ~ ~0.5 run tag @e[tag=tntrun_edge,distance=..0.1] remove tntrun_edge
 execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~ ~-1 ~ align xyz if block ~ ~ ~ minecraft:cyan_terracotta positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["tntrun_as"],Invisible:1b,Marker:1b}
-
 execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~0.31 ~-1 ~0.31 align xyz if block ~ ~ ~ minecraft:cyan_terracotta positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Invisible:1b,Marker:1b}
 execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~-0.31 ~-1 ~-0.31 align xyz if block ~ ~ ~ minecraft:cyan_terracotta positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Invisible:1b,Marker:1b}
 execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~0.31 ~-1 ~-0.31 align xyz if block ~ ~ ~ minecraft:cyan_terracotta positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Invisible:1b,Marker:1b}
 execute as @a[tag=tntrun_pc,nbt={OnGround:1b}] at @s positioned ~-0.31 ~-1 ~0.31 align xyz if block ~ ~ ~ minecraft:cyan_terracotta positioned ~0.5 ~ ~0.5 unless entity @e[tag=tntrun_as,distance=..0.1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["tntrun_as","tntrun_edge"],Invisible:1b,Marker:1b}
-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.5] remove tntrun_edge
-
+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
 scoreboard players add @e[tag=tntrun_as] tntrun_timer 1
+# 修改下面这一行的数字以调整方块消失的延迟(刻)
 execute as @e[tag=tntrun_as,scores={tntrun_timer=12}] at @s run setblock ~ ~ ~ air
 execute as @e[tag=tntrun_as] at @s unless block ~ ~ ~ minecraft:cyan_terracotta run kill @s
 execute as @e[tag=tntrun_edge] at @s unless entity @a[tag=tntrun_pc,distance=..1.51] run kill @s