
Infinite 0s weakness caused by creeper explosion
Rad586 opened this issue · 6 comments
This bug happens occasionally when taking explosion damage from creepers in my modpack.
Maybe a bug with health blast? (https://www.curseforge.com/minecraft/mc-mods/health-blast)
Mod list: https://gist.github.com/Rad586/696a472af82a0227c177b240743f99cb
Hello! Thanks for the report, I will try to reproduce and fix this.
Does it happen only under certain circumstances or does it happen everytime?
I reproduced it with only sihywtcamd, it happens in this circumstance:
1.mp4
Nothing was logged in log.
Thanks a lot for the video, I really appreciate it! I will check and get back to you 😉
Hi again,
I thought that I found a way to reproduce each time, but now I struggle reproducing. However, I'm pretty sure I found what caused the issue. If you know how to reproduce easily and have time, I'm sharing with you a version in which I included the small fix. If you could take a look or at least trying to explain me what criteria you think causes the issue to reproduce.
Here is a 1.20.2 version of the mod with the fix:
sihywtcamd-1.8.2+1.20.2.zip
It was fixed, I can't reproduce it now.
I found this bug few months ago, but I didn't take it seriously, I thought it was all random, until I somehow reproduced it when running away from a creeper. The overlay only disappears when it's overlapped by another one, and it's flashing. So I think it has a low duration.
I guess the problem comes from Math.sqrt(1.0 - (this.distanceTo(entity) / explosionRadius));
. when distance<radius, it results in nagetive value, and sqrt fails. There might be a tiny time difference to get the distance, causing it higher than radius.
And maybe final int explosionRadius = this.explosionRadius * (this.shouldRenderOverlay() ? 3 : 2);
is one reason for that, idk, maybe there's something going on with "shouldRenderOverlay".
Not sure if I said it right, just for fun.