Browse Source

修改漂浮的执行tick

HerobrineXia 6 years ago
parent
commit
7134314e06

+ 8 - 0
data/ltw/functions/clock/tick2.mcfunction

@@ -18,3 +18,11 @@ function item:tick2
 # 全局倒计时
 execute if score $countdown_fast mem matches 1.. run scoreboard players remove $countdown_fast mem 1
 scoreboard players remove @e[scores={countdown_fast=1..}] countdown_fast 1
+
+# 特殊方块给予效果
+execute as @a[gamemode=!spectator] if score @s effect_floating matches 1.. run scoreboard players add @s effect_floating 1
+execute as @a[gamemode=!spectator] if score @s effect_floating matches 11.. run effect clear @s levitation
+execute as @a[gamemode=!spectator] if score @s effect_floating matches 11.. run scoreboard players set @s effect_floating 0
+execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 1
+execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12 true
+execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true

+ 1 - 9
data/ltw/functions/clock/tick5.mcfunction

@@ -7,12 +7,4 @@ 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
-
-# 特殊方块给予效果
-execute as @a[gamemode=!spectator] if score @s effect_floating matches 1.. run scoreboard players add @s effect_floating 1
-execute as @a[gamemode=!spectator] if score @s effect_floating matches 3.. run effect clear @s levitation
-execute as @a[gamemode=!spectator] if score @s effect_floating matches 3.. run scoreboard players set @s effect_floating 0
-execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 1
-execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12 true
-execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
+execute as @a[scores={death=1..,health=1..}] at @s run function ltw:main/player_death