LTCatt 6 лет назад
Родитель
Сommit
bc2d2e9388
2 измененных файлов с 6 добавлено и 3 удалено
  1. 2 0
      data/ltw/functions/init.mcfunction
  2. 4 3
      data/mini/functions/main/tick5.mcfunction

+ 2 - 0
data/ltw/functions/init.mcfunction

@@ -25,6 +25,8 @@ forceload add 0 0
 setblock 0 0 0 jukebox
 
 # 记分板
+scoreboard objectives remove temp
+scoreboard objectives add temp dummy
 scoreboard objectives remove health
 scoreboard objectives add health health "生命值"
 scoreboard objectives remove health_disp

+ 4 - 3
data/mini/functions/main/tick5.mcfunction

@@ -5,8 +5,9 @@ execute if score $mini_type mem matches 2 run function mini:tntrun/tick5
 execute if score $mini_type mem matches 3 run function mini:hotpm/tick5
 
 # 同步生命值
-scoreboard players reset * health_disp
-scoreboard players set @a[gamemode=!spectator] health_disp 20
-execute as @a[gamemode=!spectator,scores={health=1..}] run scoreboard players operation @s health_disp = @s health
+scoreboard players reset * temp
+scoreboard players set @a[gamemode=!spectator] temp 20
+execute as @a[gamemode=!spectator,scores={health=1..}] run scoreboard players operation @s temp = @s health
+execute as @a run scoreboard players operation @s health_disp = @s temp
 execute as @a run scoreboard players operation @s mini_heart_disp = @s mini_heart
 execute as @a run scoreboard players operation @s mini_heart_disp += @s mini_heart