建立計分板:
/scoreboard objectives add damageDealt stat.damageDealt
單次執行:
/scoreboard players set _DValue damage 10
基礎部分
execute @a[score_damageDealt_min=1] ~ ~ ~ /scoreboard players operation @p[r=0] damage = @p[r=0] damageDealt
將玩家的damageDealt分數賦值給玩家的damage
execute @a[score_damageDealt_min=1] ~ ~ ~ /scoreboard players operation @p[r=0] damage /= _DValue damage
將玩家的damage分數除以10,我們設定過,_DValue的damage分數為10,讓玩家的分數除_DValue的分數就是除以10
execute @a[score_KillPlayer_min=1] ~ ~ ~ /execute @a[score_death_min=1] ~ ~ ~ /title @a[score_KillPlayer_min=1] actionbar ["\u00a7c\u00a7l殺死了 ",{"selector":"@a[score_death_min=1]","color":"yellow","bold":"true"}]
如果能檢測到KillPlayer大於等於1的玩家,並且能檢測到有death大於等於1的玩家,就提示KillPlayer大於等於1的玩家殺死了death大於等於1的玩家。
execute @a[score_death_min=1] ~ ~ ~ execute @a[score_KillPlayer_min=1] ~ ~ ~ /playsound minecraft:entity.player.levelup player @a[score_KillPlayer_min=1] ~ ~ ~ 1 1.25 1