Xing-C / Classic-and-simple-status-bars

Classic and simple status bars
GNU General Public License v3.0
5 stars 1 forks source link

Health is always X/20 even if X>20 #3

Closed maculator closed 11 months ago

maculator commented 11 months ago

Health bar does not show the real maximum health. Not sure if this is intended or a bug. Here is a screenshot: https://i.imgur.com/yGGSDca.jpg I got 20.5 ouit of 20 health. It should be 20.5/20.5

Xing-C commented 11 months ago

Sorry, this part is a bit messy. Some values are set to integers, but others are set by me to retain decimals. This is indeed an error

Xing-C commented 11 months ago

I found the problem because the maxhealth is of type int

Xing-C commented 11 months ago

image

I will upload the new version right away. Now the problem has been solved

Xing-C commented 11 months ago

image

I will upload the new version right away. Now the problem has been solved

As shown in the picture, if you remove the Coleoptera equipment, the health column will display 20/20, which is for correct display, but the real data, the health value is still 25.9/20. If you find it, I just want to say it is not a bug

Xing-C commented 11 months ago

I found that the type of vanilla armor value and armor toughness is an integer, so the decimal point is not displayed. Even the armor value of 1.8 will be displayed as 1 armor.

/give @s minecraft:elytra{AttributeModifiers:[{AttributeName:"generic.armor",Operation:0,Amount:1.9d,Slot:"chest",Name:"Armor",UUID:[I;1,2,3,4]}, {AttributeName:"generic.max_health",Operation:0,Amount:1.9d,Slot:"chest",Name:"MaxHealth",UUID:[I;1,2,3,5]}]}

image

Xing-C commented 11 months ago

Use v1.0.9

maculator commented 11 months ago

It works, thank you, good mod!

Xing-C commented 11 months ago

It works, thank you, good mod!

You're welcome, this is what I should do. I hope it's perfect