击杀提示&攻击提示

最终效果:

效果演示 效果演示

教程

建立计分板
damageDealt stat.damageDealt
damage dummy
KillPlayer playerKillCount

单次执行

  1. /scoreboard players set _DValue damage 10

基础部分

  1. execute @a[score_damageDealt_min=1] ~ ~ ~ /scoreboard players operation @p[r=0] damage = @p[r=0] damageDealt

将玩家的damageDealt分数赋值给玩家的damage

  1. execute @a[score_damageDealt_min=1] ~ ~ ~ /scoreboard players operation @p[r=0] damage /= _DValue damage

将玩家的damage分数除以10

_DValue的damage分数为10,让玩家的分数除_DValue的分数就是除以10

击杀提示

  1. 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的玩家。

  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

如果能检测到death大于等于1的玩家,并且能检测到有KillPlayer大于等于1的玩家,就播放音效给KillPlayer大于等于1的玩家

攻击提示

  1. execute @a[score_damage_min=1] ~ ~ ~ /title @p[r=0] actionbar [{"score":{"objective":"damage","name":"*"},"color":"dark_red","bold":"true"}]

如果能检测到damage大于等于1的玩家,就提示那个玩家它的damage分数

重置

  1. scoreboard players set @a[score_damageDealt_min=1] damageDealt 0
  2. scoreboard players set @a[score_death_min=1] death 0
  3. scoreboard players set @a[score_KillPlayer_min=1] KillPlayer 0
  4. scoreboard players set @a[score_damage_min=1] damage 0
  • what_name2018-04-12

                        
    • what_name2018-04-21

      这是一条回复