LTCatt 6 лет назад
Родитель
Сommit
cb5fe07f6c
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      data/item/functions/bonus_item/add_score.mcfunction

+ 4 - 3
data/item/functions/bonus_item/add_score.mcfunction

@@ -23,9 +23,10 @@ execute if score #bonus_add_score mem matches 200 run scoreboard players add @s
 scoreboard players set #score_max mem -2147483648
 execute as @a run function ltw:main/get_max_score
 tag @a remove highest
-execute as @a if score @s total_score = #score_max mem run tag @s add highest
+execute as @a if score @s total_score = #score_max mem run tag @s[scores={total_score=1..}] add highest
 execute if score #bonus_add_score mem matches 200 run scoreboard players remove @a[tag=highest,limit=1] total_score 1
 execute if score #bonus_add_score mem matches 200 run scoreboard players remove @a[tag=highest,limit=1] total_score_disp 1
-execute if score #bonus_add_score mem matches 200 if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 偷取到了 ",{"text": "1 分","color":"green"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
-execute if score #bonus_add_score mem matches 200 if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@a[tag=highest,limit=1]","color":"red"}," 被偷取了 ",{"text": "1 分","color":"red"},", 当前共有 ",{"score": {"name": "@a[tag=highest,limit=1]","objective": "total_score"}}, " 分"]
+execute if score #bonus_add_score mem matches 200 if entity @a[tag=highest] unless entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@a[tag=highest,limit=1]","color":"red"}," 被偷取了 ",{"text": "1 分","color":"red"},", 当前共有 ",{"score": {"name": "@a[tag=highest,limit=1]","objective": "total_score"}}, " 分"]
+execute if score #bonus_add_score mem matches 200 if entity @a[tag=highest] unless entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 偷取了 ",{"text": "1 分","color":"green"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
 execute if score #bonus_add_score mem matches 200 if entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 试图偷取自己的分数……"]
+execute if score #bonus_add_score mem matches 200 unless entity @a[tag=highest] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 试图偷取分数, 但所有人都一穷二白……"]