今天小编就教大家在游戏中制作击杀提示和攻击提示,相信很多玩家都非常的想知道这两种提示到底怎么制作,想知道的请看下面的内容!
原作者:what_name
看完本帖,你就可以制作出上图的效果
建立计分板:
/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 ["u00a7cu00a7l杀死了 ",{"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
如果能检测到death大于等于1的玩家,并且能检测到有KillPlayer大于等于1的玩家,就播放音效给KillPlayer大于等于1的玩家
攻击提示
execute @a[score_damage_min=1] ~ ~ ~ /title @p[r=0] actionbar [{"score":{"objective":"damage","name":"*"},"color":"dark_red","bold":"true"}]
如果能检测到damage大于等于1的玩家,就提示那个玩家它的damage分数
重置
scoreboard players set @a[score_damageDealt_min=1] damageDealt 0
scoreboard players set @a[score_death_min=1] death 0
scoreboard players set @a[score_KillPlayer_min=1] KillPlayer 0
scoreboard players set @a[score_damage_min=1] damage 0
19游戏网整理报道