Ver Fonte

修改死亡检测为1tick

HerobrineXia há 5 anos atrás
pai
commit
5141b32a4b

+ 4 - 1
data/ltw/functions/clock/tick1.mcfunction

@@ -1,4 +1,7 @@
 # 每 1 Tick 执行一次
 
 # 调用其他模块
-execute if score $state mem matches 5 run function ltw:state/5/tick1
+execute if score $state mem matches 5 run function ltw:state/5/tick1
+
+# 死亡触发
+execute as @a[scores={death=1..,health=1..}] at @s run function ltw:main/player_death

+ 0 - 3
data/ltw/functions/clock/tick5.mcfunction

@@ -5,6 +5,3 @@ schedule function ltw:clock/tick5 5t replace
 execute if score $state mem matches 0 run function ltw:state/0/tick5
 execute if score $state mem matches 5 run function ltw:state/5/tick5
 function ltw:main/tick5
-
-# 死亡触发
-execute as @a[scores={death=1..,health=1..}] at @s run function ltw:main/player_death

+ 1 - 1
data/mini/functions/diamond/player_death.mcfunction

@@ -9,7 +9,7 @@ effect give @s weakness 30 1
 
 # 处理玩家掉落物品
 execute at @s as @e[type=item,distance=..100] store result score @s temp run data get entity @s Age
-execute at @s store result score #total_drop temp run tag @e[type=item,scores={temp=..6}] add death_drop
+execute at @s store result score #total_drop temp run tag @e[type=item,scores={temp=..2}] add death_drop
 scoreboard players reset @e[type=item] temp
 # 单独处理钻石还没写
 # 掉落数量向上取整