فهرست منبع

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt 5 سال پیش
والد
کامیت
b7888fc0a8
1فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 6 5
      data/item/functions/bonus_item/stole_score.mcfunction

+ 6 - 5
data/item/functions/bonus_item/stole_score.mcfunction

@@ -1,21 +1,22 @@
 # as player
 # as player
-execute store result score #bonus_stole_score mem run data get block 0 0 0 RecordItem.tag.bonus_stole_score
+execute store result score #bonus_stole_score mem run data get storage item:bonus item.tag.bonus_stole_score
 
 
 # 获取有效的最高分玩家
 # 获取有效的最高分玩家
 function ltw:main/get_max_score
 function ltw:main/get_max_score
 tag @a remove highest
 tag @a remove highest
 tag @a remove may_highest
 tag @a remove may_highest
 execute as @a if score @s total_score = #score_max mem if score @s total_score >= #bonus_stole_score mem run tag @s add may_highest
 execute as @a if score @s total_score = #score_max mem if score @s total_score >= #bonus_stole_score mem run tag @s add may_highest
-execute at @s as @a[tag=may_highest,limit=1,sort=furthest,team=playing] run tag @s add highest
+tag @s remove may_highest
+execute as @a[tag=may_highest,limit=1,sort=random,team=playing] run tag @s add highest
 execute unless entity @a[tag=highest] run tag @s add highest
 execute unless entity @a[tag=highest] run tag @s add highest
 
 
 # 更改得分
 # 更改得分
 scoreboard players operation @s total_score += #bonus_stole_score mem
 scoreboard players operation @s total_score += #bonus_stole_score mem
 scoreboard players operation @s total_score_disp += #bonus_stole_score mem
 scoreboard players operation @s total_score_disp += #bonus_stole_score mem
-scoreboard players operation @p[tag=highest] total_score -= #bonus_stole_score mem
-scoreboard players operation @p[tag=highest] total_score_disp -= #bonus_stole_score mem
+scoreboard players operation @a[tag=highest] total_score -= #bonus_stole_score mem
+scoreboard players operation @a[tag=highest] total_score_disp -= #bonus_stole_score mem
 
 
 # 显示提示
 # 显示提示
 execute if entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 没能偷到任何人的分数……"]
 execute if entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 没能偷到任何人的分数……"]
-execute if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@p[tag=highest]","color":"red"}," 被偷取了 ",{"score": {"name": "#bonus_stole_score","objective": "mem"},"color":"red"},{"text": " 分","color":"red"},", 当前共有 ",{"score": {"name": "@p[tag=highest]","objective": "total_score"}}, " 分"]
+execute if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@a[tag=highest]","color":"red"}," 被偷取了 ",{"score": {"name": "#bonus_stole_score","objective": "mem"},"color":"red"},{"text": " 分","color":"red"},", 当前共有 ",{"score": {"name": "@a[tag=highest,limit=1]","objective": "total_score"}}, " 分"]
 execute if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 偷取了 ",{"score": {"name": "#bonus_stole_score","objective": "mem"},"color":"green"},{"text": " 分","color":"green"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
 execute if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 偷取了 ",{"score": {"name": "#bonus_stole_score","objective": "mem"},"color":"green"},{"text": " 分","color":"green"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]