show_result.mcfunction 1.6 KB

12345678910111213141516
  1. # 显示小游戏排名
  2. tellraw @s ["",{"text":"\n------ 小游戏结束! ------\n","color":"light_purple","bold":true}]
  3. # 1
  4. execute if score $show_score mem matches 1 run tellraw @s [" ",{"text": "第一名 > ","color":"red"},{"selector": "@a[tag=mini_rank1]","color":"red"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=mini_rank1]","objective": "mini_score"},"color":"gray"},{"text":")","color":"gray"}]
  5. execute if score $show_score mem matches 0 run tellraw @s [" ",{"text": "第一名 > ","color":"red"},{"selector": "@a[tag=mini_rank1]","color":"red"}]
  6. # 2
  7. execute if score $show_score mem matches 1 if entity @a[tag=mini_rank2] run tellraw @s [" ",{"text": "第二名 > ","color":"gold"},{"selector": "@a[tag=mini_rank2]","color":"gold"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=mini_rank2]","objective": "mini_score"},"color":"gray"},{"text":")","color":"gray"}]
  8. execute if score $show_score mem matches 0 if entity @a[tag=mini_rank2] run tellraw @s [" ",{"text": "第二名 > ","color":"gold"},{"selector": "@a[tag=mini_rank2]","color":"gold"}]
  9. # 3
  10. execute if score $show_score mem matches 1 if entity @a[tag=mini_rank3] run tellraw @s [" ",{"text": "第三名 > ","color":"yellow"},{"selector": "@a[tag=mini_rank3]","color":"yellow"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=mini_rank3]","objective": "mini_score"},"color":"gray"},{"text":")","color":"gray"}]
  11. execute if score $show_score mem matches 0 if entity @a[tag=mini_rank3] run tellraw @s [" ",{"text": "第三名 > ","color":"yellow"},{"selector": "@a[tag=mini_rank3]","color":"yellow"}]
  12. tellraw @s ""