LTCatt %!s(int64=6) %!d(string=hai) anos
pai
achega
e9e9d77db5

+ 7 - 4
data/ltw/functions/state/0/start_gameparty.mcfunction

@@ -5,7 +5,10 @@ scoreboard players set $count mem 0
 execute as @a[tag=hub_gameparty] run scoreboard players add $count mem 1
 
 # 根据玩家数量判定
-execute if score $count mem matches ..2 run tellraw @a[tag=hub_gameparty] [{"text": "人数不足, 需要至少 3 人, 当前仅有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, "人!"]
-execute if score $count mem matches 9.. run tellraw @a[tag=hub_gameparty] [{"text": "人数过多, 最多支持 8 人, 当前已有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, "人!"]
-execute if score $count mem matches 3..8 run tellraw @a {"text": "小游戏模式即将开始!","color":"green"}
-execute if score $count mem matches 3..8 run schedule function ltw:state/3/state_enter 3s replace
+execute if score $count mem matches ..2 run tellraw @a[tag=hub_gameparty] [{"text": "人数不足, 需要至少 3 人, 当前仅有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, " 人!"]
+execute if score $count mem matches 9.. run tellraw @a[tag=hub_gameparty] [{"text": "人数过多, 最多支持 8 人, 当前已有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, " 人!"]
+
+# 开始小游戏
+execute if score $count mem matches 3..8 run tag @a remove watcher
+execute if score $count mem matches 3..8 run tag @a[tag=!hub_gameparty] add watcher
+execute if score $count mem matches 3..8 run function ltw:state/3/state_enter

+ 3 - 0
data/mini/functions/hotpm/game_init.mcfunction

@@ -20,6 +20,9 @@ setblock 1000 28 3022 minecraft:redstone_block
 setblock 1000 27 2999 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"?",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:23,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm010",sizeY:24,sizeZ:23,showboundingbox:0b}
 setblock 1000 28 2999 minecraft:redstone_block
 
+# 关闭伤害
+gamerule fallDamage false
+
 #   101
 setblock 1023 4 3022 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"!",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:23,posZ:0,integrity:1.0f,showair:0b,name:"mini:hotpm101",sizeY:24,sizeZ:23,showboundingbox:0b}
 setblock 1023 5 3022 minecraft:redstone_block

+ 5 - 4
data/mini/functions/hotpm/player_enter.mcfunction

@@ -1,6 +1,6 @@
 # 单个玩家开始小游戏时执行
 title @s clear
-gamemode adventure @s
+gamemode creative
 
 # 状态效果
 effect clear @s
@@ -14,11 +14,12 @@ tag @s remove pm_hoding
 tag @s remove pm_damage_dealt
 tag @s remove pm_damage_taken
 
-# 关闭伤害
-gamerule fallDamage false
+# 调整模式
+gamemode adventure @s[tag=!watcher]
+gamemode spectator @s[tag=watcher]
 
 # 传送玩家
-spreadplayers 1023 3021 5 5 false @s
+spreadplayers 1023 3021 5 5 false @s[tag=!watcher]
 schedule function mini:hotpm/player_enter2 1t replace
 # schedule: tp @a ~ 25 ~
 

+ 1 - 1
data/mini/functions/hotpm/player_enter2.mcfunction

@@ -1,2 +1,2 @@
 # spreadplayer 后不能立即传送,所以延迟 1tick
-execute as @a at @s run tp @s ~ 25 ~
+execute as @a[tag=!watcher] at @s run tp @s ~ 25 ~

+ 3 - 2
data/mini/functions/main/player_enter.mcfunction

@@ -1,6 +1,7 @@
 # 单个玩家开始小游戏时执行
-tag @s add mini_running
-scoreboard players set @s mini_score 0
+tag @s[tag=!watcher] add mini_running
+scoreboard players set @s[tag=!watcher] mini_score 0
+scoreboard players set @s[tag=watcher] mini_score -9999999
 
 execute if score $mini_type mem matches 1 run function mini:parkour/player_enter
 execute if score $mini_type mem matches 2 run function mini:tntrun/player_enter

+ 4 - 1
data/mini/functions/parkour/game_init.mcfunction

@@ -3,4 +3,7 @@ forceload add 1000 1000 1050 1050
 
 # 生成地图
 setblock 1000 10 1000 minecraft:structure_block{mode:"LOAD",name:"mini:parkour"}
-setblock 1000 11 1000 minecraft:redstone_block
+setblock 1000 11 1000 minecraft:redstone_block
+
+# 关闭伤害
+gamerule fallDamage false

+ 6 - 5
data/mini/functions/parkour/player_enter.mcfunction

@@ -1,6 +1,6 @@
 # 单个玩家开始小游戏时执行
 title @s clear
-gamemode adventure @s
+gamemode creative
 
 # 状态效果
 effect clear @s
@@ -9,8 +9,9 @@ effect give @s instant_health 10 0 true
 effect give @s night_vision 1000000 0 true
 effect give @s resistance 1000000 4 true
 
-# 关闭伤害
-gamerule fallDamage false
-
 # 传送玩家
-tp @s 1005 15 1005
+tp @s[tag=!watcher] 1005 15 1005
+
+# 调整模式
+gamemode adventure @s[tag=!watcher]
+gamemode spectator @s[tag=watcher]

+ 5 - 1
data/mini/functions/tntrun/game_init.mcfunction

@@ -6,4 +6,8 @@ setblock 1000 10 2000 minecraft:structure_block{mode:"LOAD",name:"mini:tntrun"}
 setblock 1000 11 2000 minecraft:redstone_block
 
 # 清理残余实体
-kill @e[tag=tntrun_block]
+kill @e[tag=tntrun_block]
+
+# 关闭伤害
+gamerule fallDamage false
+gamerule fireDamage false

+ 6 - 6
data/mini/functions/tntrun/player_enter.mcfunction

@@ -1,6 +1,6 @@
 # 单个玩家开始小游戏时执行
 title @s clear
-gamemode adventure @s
+gamemode creative
 
 # 状态效果
 effect clear @s
@@ -9,12 +9,8 @@ effect give @s instant_health 10 0 true
 effect give @s night_vision 1000000 0 true
 effect give @s resistance 1000000 4 true
 
-# 关闭伤害
-gamerule fallDamage false
-gamerule fireDamage false
-
 # 传送玩家
-spreadplayers 1011.5 2011.5 7 7 false @s
+spreadplayers 1011.5 2011.5 7 7 false @s[tag=!watcher]
 schedule function mini:tntrun/player_enter2 1t replace
 # schedule: tp @a ~ ~-3 ~
 
@@ -22,3 +18,7 @@ schedule function mini:tntrun/player_enter2 1t replace
 tag @s remove tntrun_pc
 schedule function mini:tntrun/player_enter3 2s replace
 # schedule: tag @a add tntrun_pc
+
+# 调整模式
+gamemode adventure @s[tag=!watcher]
+gamemode spectator @s[tag=watcher]

+ 1 - 1
data/mini/functions/tntrun/player_enter2.mcfunction

@@ -1,2 +1,2 @@
 # spreadplayer 后不能立即传送,所以延迟 1tick
-execute as @a at @s run tp @s ~ ~-3 ~
+execute as @a[tag=!watcher] at @s run tp @s ~ ~-3 ~

+ 1 - 1
data/mini/functions/tntrun/player_enter3.mcfunction

@@ -1,2 +1,2 @@
 # 让玩家可以触发地板掉落
-tag @a add tntrun_pc
+tag @a[tag=!watcher] add tntrun_pc