Madis0 / OneBar

A Minecraft HUD mod for Fabric Loader
Other
8 stars 2 forks source link

Advanced health estimate #7

Open Madis0 opened 3 years ago

Madis0 commented 3 years ago

When having multiple similar effects - regeneration, poison, wither - how would one determine the final health? Cannot just use a max or min value, nor an average.

At the very least it should prioritize by the effect duration and level.

I think it should be a weighed average of estimated health with the weigh of effect duration * effect level. However, what would be the weighs of non-effect states (e.g. drowning)? Possibly the time in ticks to die.

Edit: 1.4.1 added parentheses, which helps with the readability a bit.

Madis0 commented 2 years ago

It has been suggested to use min(all effects) to make the player "act early" in case of dangers. It could be a possible option, though it definitely does undermine the positive effects (e.g. using golden apples in a Wither fight).