Backport to 1.21.4: Revert #2095 due to Leader Zombie health bugfix breaking vanilla farms (#2842)

Co-authored-by: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com>
This commit is contained in:
neoforged-automation[bot] 2025-11-29 10:32:16 +01:00 committed by GitHub
parent 28b7490e58
commit 5cd706524f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,18 +37,3 @@
if (p_219160_.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
return flag;
}
@@ -559,10 +_,14 @@
.addOrReplacePermanentModifier(
new AttributeModifier(LEADER_ZOMBIE_BONUS_ID, this.random.nextDouble() * 0.25 + 0.5, AttributeModifier.Operation.ADD_VALUE)
);
+ var damageTaken = getMaxHealth() - getHealth();
this.getAttribute(Attributes.MAX_HEALTH)
.addOrReplacePermanentModifier(
new AttributeModifier(LEADER_ZOMBIE_BONUS_ID, this.random.nextDouble() * 3.0 + 1.0, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)
);
+ // Neo: fix MC-219981 by resetting the leader zombie's health based on the new max health
+ // without disregarding damage already taken (if any)
+ setHealth(getMaxHealth() - damageTaken);
this.setCanBreakDoors(true);
}
}