Sfoglia il codice sorgente

修复生命不更新 Bug

LTCatt 6 anni fa
parent
commit
dccd19856a

+ 4 - 5
data/mini/functions/colormatch/player_enter.mcfunction

@@ -10,6 +10,10 @@ gamerule naturalRegeneration true
 effect give @s night_vision 1000000 0 true
 effect give @s resistance 1000000 4 true
 
+# 设置玩家生命
+scoreboard players set @s[tag=!watcher,tag=!rejoining] mini_heart 3
+function mini:main/player_max_health
+
 # 传送玩家
 tp @s[tag=!watcher,tag=!rejoining,tag=!debug] 1062 16.5 4012
 
@@ -17,10 +21,5 @@ tp @s[tag=!watcher,tag=!rejoining,tag=!debug] 1062 16.5 4012
 gamemode spectator @s[tag=!debug]
 gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
 
-# 设置玩家生命数量
-scoreboard players set @s[tag=!watcher,tag=!rejoining] mini_heart 3
-scoreboard players reset @s[tag=!watcher,tag=rejoining] mini_heart
-function mini:main/player_max_health
-
 # 重新加入处理
 execute if entity @s[tag=rejoining] run function mini:main/player_failed

+ 4 - 5
data/mini/functions/hotpm/player_enter.mcfunction

@@ -10,6 +10,10 @@ gamerule naturalRegeneration true
 effect give @s night_vision 1000000 0 true
 effect give @s resistance 1000000 4 true
 
+# 设置玩家生命
+scoreboard players set @s[tag=!watcher,tag=!rejoining] mini_heart 2
+function mini:main/player_max_health
+
 # 清理 Tag
 tag @s remove pm_holding
 tag @s remove pm_damage_dealt
@@ -25,10 +29,5 @@ tp @s[tag=!watcher,tag=!rejoining,tag=!debug] 1023 25 3021
 gamemode spectator @s[tag=!debug]
 gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
 
-# 设置玩家生命数量
-scoreboard players set @s[tag=!watcher,tag=!rejoining] mini_heart 2
-scoreboard players reset @s[tag=!watcher,tag=rejoining] mini_heart
-function mini:main/player_max_health
-
 # 重新加入处理
 execute if entity @s[tag=rejoining] run function mini:main/player_failed

+ 3 - 0
data/mini/functions/parkour/player_enter.mcfunction

@@ -9,6 +9,9 @@ effect give @s saturation 1000000 0 true
 gamerule naturalRegeneration true
 effect give @s resistance 1000000 4 true
 
+# 设置玩家生命
+attribute @s generic.max_health base set 20
+
 # 计分板重置
 scoreboard players reset @s treasure
 scoreboard players set @s[tag=!watcher,tag=!rejoining,tag=!debug] treasure 0

+ 3 - 0
data/mini/functions/phantom/player_enter.mcfunction

@@ -9,6 +9,9 @@ effect give @s saturation 1000000 0 true
 effect give @s instant_health 10 0 true
 gamerule naturalRegeneration false
 
+# 设置玩家生命
+attribute @s generic.max_health base set 20
+
 # 计分板重置
 scoreboard players reset @s kill_phantom
 scoreboard players reset @s kill_phantom2

+ 3 - 0
data/mini/functions/slime/player_enter.mcfunction

@@ -10,6 +10,9 @@ effect give @s instant_health 10 0 true
 gamerule naturalRegeneration false
 effect give @s night_vision 1000000 0 true
 
+# 设置玩家生命
+attribute @s generic.max_health base set 20
+
 # 传送玩家
 tp @s[tag=!debug] 1002.0 7.5 7002.0
 

+ 3 - 0
data/mini/functions/tntrun/player_enter.mcfunction

@@ -10,6 +10,9 @@ gamerule naturalRegeneration true
 effect give @s night_vision 1000000 0 true
 effect give @s resistance 1000000 4 true
 
+# 设置玩家生命
+attribute @s generic.max_health base set 20
+
 # 传送玩家
 spreadplayers 1011.5 2011.5 4 4 false @s[tag=!watcher,tag=!rejoining,tag=!debug]
 # schedule: tp @a ~ ~-3 ~

+ 3 - 0
data/mini/functions/zombie/player_enter.mcfunction

@@ -10,6 +10,9 @@ effect give @s instant_health 10 0 true
 gamerule naturalRegeneration false
 effect give @s night_vision 1000000 0 true
 
+# 设置玩家生命
+attribute @s generic.max_health base set 20
+
 # 传送玩家
 tp @s[tag=!debug] 1010.5 12 5013.0