Skip to content

Fix one punch man not killing some mobs#1812

Merged
granny merged 1 commit into
PurpurMC:ver/26.2from
kacimiamine:fix/one-punch-man
Jul 19, 2026
Merged

Fix one punch man not killing some mobs#1812
granny merged 1 commit into
PurpurMC:ver/26.2from
kacimiamine:fix/one-punch-man

Conversation

@kacimiamine

Copy link
Copy Markdown
Contributor

It looks like there are checks after for the absorption, armor, resistance etc... that decreases the damage amount, so using getHealth() won't kill the mobs with those modifiers (wither, zombie etc...)

The best fix it to set the damage to the max value possible `Float.MAX_VALUE. This is more appropriate and also safe since we have a check after the damage:

if (Float.isNaN(damage) || Float.isInfinite(damage)) {
    damage = Float.MAX_VALUE;
}

Fixes #1811

@momo-OwO-qwq momo-OwO-qwq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job bro 👍

@granny
granny merged commit 948343a into PurpurMC:ver/26.2 Jul 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Zombie variants survive one-punch-in-creative empty hand despite receiving massive damage and having no armor or reinforcements

3 participants