HerobrineXia 6 лет назад
Родитель
Сommit
7d56d6312b

+ 1 - 1
data/mini/functions/tntrun/game_start.mcfunction

@@ -7,6 +7,6 @@ schedule function mini:tntrun/player_enter3 2s replace
 # HUD
 execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay list total_score_disp
 execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay belowName total_score_disp
-execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay sidebar total_score
+execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay sidebar layer
 scoreboard players set $bossbar_type mem 0
 function lib:bossbar/show

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

@@ -1,3 +1,5 @@
 # 计分板初始化
 scoreboard objectives remove tntrun_timer
-scoreboard objectives add tntrun_timer dummy ["TNT Run 方块消失计时"]
+scoreboard objectives add tntrun_timer dummy ["TNT Run 方块消失计时"]
+scoreboard objectives remove layer
+scoreboard objectives add layer dummy ["玩家层数"]

+ 6 - 0
data/mini/functions/tntrun/tick2.mcfunction

@@ -7,3 +7,9 @@ execute as @e[tag=tntrun_edge] at @s unless entity @a[tag=tntrun_pc,distance=..1
 
 # 玩家死亡判断
 execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ magma_block run function mini:tntrun/player_failed
+
+# 显示层数
+execute as @a[tag=mini_running] at @s if entity @s[y=35,dy=10] run scoreboard players set @s layer 4
+execute as @a[tag=mini_running] at @s if entity @s[y=30,dy=5] run scoreboard players set @s layer 3
+execute as @a[tag=mini_running] at @s if entity @s[y=25,dy=5] run scoreboard players set @s layer 2
+execute as @a[tag=mini_running] at @s if entity @s[y=20,dy=5] run scoreboard players set @s layer 1