Explorar el Código

修复死亡传送

LTCatt hace 5 años
padre
commit
3599e8991b

+ 4 - 4
data/ltw/functions/clock/tick2.mcfunction

@@ -1,6 +1,10 @@
 # 每秒执行一次
 schedule function ltw:clock/tick2 2t replace
 
+# 死亡触发
+execute as @a[x=-12,y=7,z=-102,distance=..5] run tp @s -13 9 -42
+execute as @a[x=-12,y=7,z=-102,distance=..5] at @s run function ltw:main/player_death
+
 # 调用其他模块
 function lib:bossbar/tick2
 execute if score $state mem matches 3 run function ltw:state/3/tick2
@@ -24,7 +28,3 @@ 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[tag=temp_death] at @s run function ltw:main/player_death
-execute as @a[scores={death=1..}] run tag @s add temp_death

+ 1 - 3
data/ltw/functions/init.mcfunction

@@ -1,7 +1,7 @@
 # 全局初始化
 
 # 游戏数据
-setworldspawn 10 13 10
+setworldspawn -12 7 -102
 forceload remove all
 time set midnight
 weather clear
@@ -41,8 +41,6 @@ scoreboard objectives add health health "生命值"
 scoreboard objectives remove health_disp
 scoreboard objectives add health_disp dummy "生命值"
 scoreboard objectives modify health_disp rendertype hearts
-scoreboard objectives remove death
-scoreboard objectives add death deathCount "死亡触发"
 scoreboard objectives remove mem
 scoreboard objectives add mem dummy "全局变量"
 scoreboard objectives remove total_score

+ 0 - 2
data/ltw/functions/main/player_death.mcfunction

@@ -1,4 +1,2 @@
 # 当玩家死亡后触发
-scoreboard players reset @s death
-tag @s remove temp_death
 execute if score $state mem matches 5 run function ltw:state/5/player_death

+ 2 - 0
data/ltw/functions/main/player_enter.mcfunction

@@ -1,5 +1,7 @@
 # 当玩家加入游戏时触发
 
+spawnpoint @s -12 7 -102
+
 # TODO: v0.3 升级函数
 execute if entity @s[tag=!v02upgrade,scores={gold_total=1..}] run function ltw:main/player_upgrade
 tag @s add v02upgrade

+ 0 - 2
data/mini/functions/diamond/game/respawn1.mcfunction

@@ -11,5 +11,3 @@ gamerule naturalRegeneration false
 
 # 传送玩家
 tp @s 1016 280 5016
-tag @s add respawning
-schedule function mini:diamond/game/respawn2 1t append

+ 0 - 1
data/mini/functions/diamond/game/respawn2.mcfunction

@@ -1 +0,0 @@
-tag @a remove respawning

+ 3 - 3
data/mini/functions/diamond/tick2.mcfunction

@@ -1,3 +1,3 @@
-execute as @a[team=playing] unless score @s death matches 1.. store result score @s posX run data get entity @s Pos[0]
-execute as @a[team=playing] unless score @s death matches 1.. store result score @s posY run data get entity @s Pos[1]
-execute as @a[team=playing] unless score @s death matches 1.. store result score @s posZ run data get entity @s Pos[2]
+execute as @a[team=playing] store result score @s posX run data get entity @s Pos[0]
+execute as @a[team=playing] store result score @s posY run data get entity @s Pos[1]
+execute as @a[team=playing] store result score @s posZ run data get entity @s Pos[2]

+ 2 - 1
data/test/functions/fast_countdown.mcfunction

@@ -2,4 +2,5 @@
 
 scoreboard players set #start_countdown mem 3
 scoreboard players set $countdown mem 1
-scoreboard players set $countdown_fast mem 5
+scoreboard players set $countdown_fast mem 5
+tellraw @a ["",{"text": ">> ","color": "aqua","bold": true}, {"text": "管理员按下了快进键!","color": "aqua"}]