Pārlūkot izejas kodu

修改为范围判断

LTCatt 6 gadi atpakaļ
vecāks
revīzija
5b05162e9e

+ 4 - 0
data/mini/functions/parkour/tick2.mcfunction

@@ -7,3 +7,7 @@ execute if score $countdown_fast mem matches 5 run playsound block.note_block.sn
 execute if score $countdown_fast mem matches 5 run playsound block.note_block.snare block @a[tag=parkour_portal] 1010 10 1033 1 2
 execute if score $countdown_fast mem matches 10 run playsound block.note_block.snare block @a[tag=parkour_portal] 1007 15 1051 1 2
 execute if score $countdown_fast mem matches 10 run playsound block.note_block.snare block @a[tag=parkour_portal] 1010 10 1033 1 2
+
+# 传送门粒子
+execute if score $parkour_door mem matches 0 run particle reverse_portal 1009 28 1031 1 2 1 0.1 50
+execute if score $parkour_door mem matches 1 run particle portal 1014.5 21.5 1057.0 0 1.5 1 1 15

+ 2 - 2
data/mini/functions/parkour/tick5.mcfunction

@@ -4,8 +4,8 @@ execute as @a[tag=mini_running,x=1005,y=11,z=1018,dx=2,dy=3,dz=2] run function m
 # 掉落方块保持
 execute as @e[type=falling_block,tag=parkour_block] run data modify entity @s Time set value 1
 
-# 传送门粒子
-execute if score $parkour_door mem matches 1 run particle minecraft:portal 1014.5 21.5 1057.0 0 1.5 1 1 30
+# 开门判断
+execute positioned 1009 28 1031 if score $parkour_door mem matches 0 as @p[tag=mini_running,distance=..6] run function mini:parkour/game/open_the_door
 
 # 标记是否通过传送门
 tag @a[x=1015.0,y=20.0,z=1055.0,dx=2,dy=4,dz=4,gamemode=!spectator] remove parkour_portal