next.mcfunction 2.0 KB

123456789101112131415161718192021222324252627
  1. # 选取下一轮选择的人群
  2. tag @a remove new_selector
  3. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank1] add new_selector
  4. execute if entity @a[tag=mini_rank1] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第一名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
  5. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank2] add new_selector
  6. execute unless entity @a[tag=mini_rank1] if entity @a[tag=mini_rank2] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第二名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
  7. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank3] add new_selector
  8. execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] if entity @a[tag=mini_rank3] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第三名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
  9. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank4] add new_selector
  10. execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] unless entity @a[tag=mini_rank3] if entity @a[tag=mini_rank4] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},{"text":"轮到其他人选择奖励了!","color":"gold"}]
  11. # 以玩家为对象开始执行
  12. execute as @a[tag=new_selector] run function ltw:state/7/next2
  13. execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
  14. execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end
  15. # 初始化倒计时
  16. scoreboard players set $countdown mem 10
  17. # 播放音效
  18. execute as @a[tag=new_selector] at @s run function lib:sounds/hit
  19. execute if entity @a[tag=new_selector] as @a[tag=!new_selector] at @s run function lib:sounds/hit2