aqupa 4 ani în urmă
părinte
comite
ab2494b6b3

+ 4 - 1
data/ltw/functions/state/3/state_enter.mcfunction

@@ -37,4 +37,7 @@ execute if score $round mem matches 5 if score $random mem matches 0 run scorebo
 execute if score $round mem matches 5 if score $random mem matches 1 run scoreboard players set $mini_type mem 102
 
 # 初始化小游戏
-function mini:main/game_init
+function mini:main/game_init
+
+# 清理残留实体
+function mini:main/kill_remaining_entity

+ 4 - 1
data/ltw/functions/state/4/state_enter.mcfunction

@@ -10,4 +10,7 @@ scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard players set $bossbar_type mem 0
-function lib:bossbar/show
+function lib:bossbar/show
+
+# 清理残留实体
+function mini:main/kill_remaining_entity

+ 3 - 3
data/mini/functions/main/kill_remaining_entity.mcfunction

@@ -1,7 +1,7 @@
-# 用game_id标记小游戏中的掉落物,清除遗留的掉落物
+# 用game_id标记所有玩家以外的实体,并清除遗留实体
 
 scoreboard players add @e[type=!player] game_id 0
 scoreboard players operation @e[type=!player,scores={game_id=0}] game_id = $ game_id
 scoreboard players set item_test mem 0
-execute store result score item_test mem as @e[type=!player] unless score @s game_id = $ game_id run kill @s
-execute if score item_test mem matches 1.. run tellraw @a ["清理了",{"score":{"name": "item_test","objective": "mem"}},"个尸体"]
+execute store result score item_test mem as @e[type=!player] unless score @s game_id = $ game_id run tp @s ~ ~-1000 ~
+execute if score item_test mem matches 1.. run tellraw @a ["清理了",{"score":{"name": "item_test","objective": "mem"}},"个实体"]

+ 1 - 4
data/mini/functions/main/tick20.mcfunction

@@ -7,7 +7,4 @@ execute if score $mini_type mem matches 101 run function mini:diamond/tick20
 execute if score $mini_type mem matches 102 run function mini:trade/tick20
 
 # 结束游戏判定
-function mini:main/check_game_end
-
-# 清理残留掉落物
-function mini:main/kill_remaining_entity
+function mini:main/check_game_end