我的世界攻击提示和受伤的血量命令方块使用方法
时间:2017-12-11 16:01:21 来源:网络 作者:未知我的世界攻击提示和受伤的血量命令方块如何使用呢?我的世界游戏中这两个功能如何使用呢?下面就为大家带来我的世界攻击提示和受伤的血量命令方块的详细使用方法。
原理
1.有一个计分板判据可以记录玩家攻击的伤害,每打一次分数都会增加
2.由于计分板没有小数,攻击伤害一般会记录到百为或十位上
3.我们可以用除法和除余法把伤害记录除掉
4.最后就可以展示伤害了然后清除攻击伤害分数就可以了
1.受伤显示也一样可以记录玩家受伤害的
2.一般会记录到百为或十位上
3.我们可以用除法和除余法把受伤血量记录除掉
4.最后就可以展示了然后清除分数就可以了
伤害指令:
1.scoreboard objectives add gong stat.damageDealt
2.scoreboard objectives add ah dummy
3.scoreboard objectives add ha dummy
高频
0.execute @a[score_gong_min=0] ~ ~ ~ scoreboard players operation @p ah = @p gong 由于需要除和除余自然需要2个计分板
1.execute @a[score_gong_min=0] ~ ~ ~ /scoreboard players operation @p gong /= 10 ha 普通的除,这样就可以获取伤害整数了
2.execute @a[score_gong_min=0] ~ ~ ~ /scoreboard players operation @p ah %= 10 ha 除余,ah = @p gong这个是和gong分数同步
3.execute @a[score_gong_min=0] ~ ~ ~ /tellraw @p [{"text":"[提示] 你的攻击伤害为","color":"gold"},{"score":{"name":"@p","objective":"gong"},"color":"red"},{"text":".","color":"red"},{"score":{"name":"@p","objective":"ah"},"color":"red"}] 展示
4.scoreboard players reset @a gong 清除分数
5.scoreboard players set 10 ha 10 除的分数
受伤血量
1./scoreboard objectives add sh1 dummy
2./scoreboard objectives add sh stat.damageTaken
3./scoreboard objectives add hai dummy
高频
0.execute @a[score_sh_min=0] ~ ~ ~ scoreboard players operation @p hai = @p sh 让你受伤血量和hai计分板同步
1.execute @a[score_sh_min=0] ~ ~ ~ /scoreboard players operation @p sh /= 10 sh1 除
2.execute @a[score_sh_min=0] ~ ~ ~ /scoreboard players operation @p hai %= 10 sh1 除余
3.execute @a[score_sh_min=0] ~ ~ ~ /tellraw @p [{"text":"[提示] 你已失去","color":"gold"},{"score":{"name":"@p","objective":"sh"},"color":"red"},{"text":".","color":"red"},{"score":{"name":"@p","objective":"hai"},"color":"red"},{"text":"滴血","color":"gold"}] 展示
4.scoreboard players reset @a sh
5.scoreboard players set 10 sh1 10