我的世界攻擊提示和受傷的血量命令方塊使用方法
時間:2017-12-11 16:01:21 來源:網絡 作者:未知我的世界攻擊提示和受傷的血量命令方塊如何使用呢?我的世界游戲中這兩個功能如何使用呢?下面就為大家?guī)砦业氖澜绻籼崾竞褪軅难棵罘綁K的詳細使用方法。
原理
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