start_gameparty.mcfunction 854 B

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