Browse Source

修改漂浮速度

HerobrineXia 6 years ago
parent
commit
d13572c23f
2 changed files with 8 additions and 2 deletions
  1. 6 2
      data/ltw/functions/clock/tick5.mcfunction
  2. 2 0
      data/ltw/functions/init.mcfunction

+ 6 - 2
data/ltw/functions/clock/tick5.mcfunction

@@ -10,5 +10,9 @@ function ltw:main/tick5
 execute as @a[scores={death=1..,health=1..}] at @s run function ltw:main/player_death
 
 # 特殊方块给予效果
-execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 5 true
-execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
+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

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

@@ -51,6 +51,8 @@ scoreboard objectives remove leave_game
 scoreboard objectives add leave_game minecraft.custom:leave_game "离开游戏"
 scoreboard objectives remove game_id
 scoreboard objectives add game_id dummy "游戏编号"
+scoreboard objectives remove effect_floating
+scoreboard objectives add effect_floating dummy "悬浮计时"
 scoreboard players set $ game_id 0
 
 # 商店系统记分板