本人没啥文采也就这样吧 众所周知
在原版mc玩家造成伤害只会通过粒子效果来表示
虽然可以通过计分板将伤害显示到屏幕上但总感觉差点意思
所以我突发奇想如果让伤害“跳”起来,那感觉不就上来吗
效果:

说明
支持9位数值(10亿位因为计分板上限计算时会直接变负数
)
因为1.12的限制,数字位置是~-0.5 ~0.3 ~-0.5 ---~0.4 ~0.3 ~0.4 ,固定的斜向所以导致特定的视角看数字会叠到一起(这个实在没办法)
当然,数字偏向屏幕右侧是对的,左侧就反着的(e,也是实在没办法,都1.12了要什么自行车(有啥好的解决方法也可以提一下,感谢))
使用的话,把计分板数赋值到实体的display.damage计分板就行
赋值的时候建议排除掉盔甲架或者tag为display.count的实体
这玩意最大的缺陷就是显示的效果(为什么1.12没有局部坐标!)
原理
思路:虽说穷举解决一切,但是21亿有点过头了,首先排除穷举
,这里使用的是拆数值的方法,通过将数值的每一位都拆下来然后赋值给盔甲架(原本是打算用区域效果云的,但是这玩意不吃motion所以换盔甲架(可恶这样就多用了两条指令(生气)))
判断数值位数:
既然要拆数值那就要先判定数值的位数,这里直接用function的if就行
function 函数 if @s[score_display.damage_min=0,score_display.damage=9]复制代码这样便能判断1位,后面套就行
10~99 2位
100~999 3位
……
拆数值:
如何拆开呐,很简单,÷×-,利用计分板不支持小数和四舍五入(我印象里是支持四舍五入的,但是经过网易和国际的实测并不支持)的特点直接就能拆出来非常简单
123/100=1
1*100=100
123-100=23复制代码类似这样就拆出来了具体的话便是
scoreboard players operation @s display.damage /= 10 display.compute
#
scoreboard players operation @s display.damage *= 10 display.compute
scoreboard players operation @s display.damage1 -= @s display.damage
scoreboard players operation @s display.damage = @s display.damage1 #备份,提供给下一位的拆解复制代码然后再在#的位置插入盔甲架的生成和赋值即可,这样拆解2位的就完成了(1位还用拆吗)3456789位直接套用就行
summon minecraft:armor_stand ~-0.4 ~0.3 ~-0.4 {Tags:["display.10","display.count"],NoAI:1b,Motion:[0.03,0.65,0.03],Invisible:1,Marker:1}
scoreboard players operation @e[r=2,tag=display.10] display.compute = @s display.damage复制代码最后接一个转入函数的转到下一位的拆解
function damage_display:value/1复制代码最后的显示数字直接用entitydata整体修改即可
entitydata @e[tag=display.count,score_display.compute_min=0,score_display.compute=0,r=2] {CustomName:"§c§l0",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=1,score_display.compute=1,r=2] {CustomName:"§c§l1",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=2,score_display.compute=2,r=2] {CustomName:"§c§l2",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=3,score_display.compute=3,r=2] {CustomName:"§c§l3",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=4,score_display.compute=4,r=2] {CustomName:"§c§l4",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=5,score_display.compute=5,r=2] {CustomName:"§c§l5",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=6,score_display.compute=6,r=2] {CustomName:"§c§l6",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=7,score_display.compute=7,r=2] {CustomName:"§c§l7",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=8,score_display.compute=8,r=2] {CustomName:"§c§l8",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=9,score_display.compute=9,r=2] {CustomName:"§c§l9",CustomNameVisible:1b,NoAI:0b}
scoreboard players reset @s display.damage #最后别忘了清除数据复制代码这样一套下来运算9位的数值只要98指令,1位需要32指令,比穷举好使多了(但是显示效果不如穷举(生气))
下载

伤害数值显示.rar
(4.97 KB, 下载次数: 0)
在原版mc玩家造成伤害只会通过粒子效果来表示
虽然可以通过计分板将伤害显示到屏幕上但总感觉差点意思
所以我突发奇想如果让伤害“跳”起来,那感觉不就上来吗

效果:

说明
支持9位数值(10亿位因为计分板上限计算时会直接变负数

因为1.12的限制,数字位置是~-0.5 ~0.3 ~-0.5 ---~0.4 ~0.3 ~0.4 ,固定的斜向所以导致特定的视角看数字会叠到一起(这个实在没办法)
当然,数字偏向屏幕右侧是对的,左侧就反着的(e,也是实在没办法,都1.12了要什么自行车(有啥好的解决方法也可以提一下,感谢))
使用的话,把计分板数赋值到实体的display.damage计分板就行
赋值的时候建议排除掉盔甲架或者tag为display.count的实体
这玩意最大的缺陷就是显示的效果(为什么1.12没有局部坐标!)
原理
思路:虽说穷举解决一切,但是21亿有点过头了,首先排除穷举

判断数值位数:
既然要拆数值那就要先判定数值的位数,这里直接用function的if就行
function 函数 if @s[score_display.damage_min=0,score_display.damage=9]复制代码这样便能判断1位,后面套就行
10~99 2位
100~999 3位
……
拆数值:
如何拆开呐,很简单,÷×-,利用计分板不支持小数和四舍五入(我印象里是支持四舍五入的,但是经过网易和国际的实测并不支持)的特点直接就能拆出来非常简单
123/100=1
1*100=100
123-100=23复制代码类似这样就拆出来了具体的话便是
scoreboard players operation @s display.damage /= 10 display.compute
#
scoreboard players operation @s display.damage *= 10 display.compute
scoreboard players operation @s display.damage1 -= @s display.damage
scoreboard players operation @s display.damage = @s display.damage1 #备份,提供给下一位的拆解复制代码然后再在#的位置插入盔甲架的生成和赋值即可,这样拆解2位的就完成了(1位还用拆吗)3456789位直接套用就行
summon minecraft:armor_stand ~-0.4 ~0.3 ~-0.4 {Tags:["display.10","display.count"],NoAI:1b,Motion:[0.03,0.65,0.03],Invisible:1,Marker:1}
scoreboard players operation @e[r=2,tag=display.10] display.compute = @s display.damage复制代码最后接一个转入函数的转到下一位的拆解
function damage_display:value/1复制代码最后的显示数字直接用entitydata整体修改即可
entitydata @e[tag=display.count,score_display.compute_min=0,score_display.compute=0,r=2] {CustomName:"§c§l0",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=1,score_display.compute=1,r=2] {CustomName:"§c§l1",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=2,score_display.compute=2,r=2] {CustomName:"§c§l2",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=3,score_display.compute=3,r=2] {CustomName:"§c§l3",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=4,score_display.compute=4,r=2] {CustomName:"§c§l4",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=5,score_display.compute=5,r=2] {CustomName:"§c§l5",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=6,score_display.compute=6,r=2] {CustomName:"§c§l6",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=7,score_display.compute=7,r=2] {CustomName:"§c§l7",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=8,score_display.compute=8,r=2] {CustomName:"§c§l8",CustomNameVisible:1b,NoAI:0b}
entitydata @e[tag=display.count,score_display.compute_min=9,score_display.compute=9,r=2] {CustomName:"§c§l9",CustomNameVisible:1b,NoAI:0b}
scoreboard players reset @s display.damage #最后别忘了清除数据复制代码这样一套下来运算9位的数值只要98指令,1位需要32指令,比穷举好使多了(但是显示效果不如穷举(生气))
下载

伤害数值显示.rar
(4.97 KB, 下载次数: 0)