Skip to content

Fix lastHurt tracking post-reduction damage#3203

Open
Shadows-of-Fire wants to merge 1 commit into
neoforged:26.1.xfrom
Shadows-of-Fire:no-inflicted-damage
Open

Fix lastHurt tracking post-reduction damage#3203
Shadows-of-Fire wants to merge 1 commit into
neoforged:26.1.xfrom
Shadows-of-Fire:no-inflicted-damage

Conversation

@Shadows-of-Fire
Copy link
Copy Markdown
Contributor

After #3101, LivingEntity#lastHurt was tracking DamageContainer#getInflictedDamage, which is a post-reduction damage value. The way that lastHurt is actually used, however, requires tracking pre-reduction values, otherwise having damage reduction can incur i-frame ignoring attack cycles.

The side effect of this, however, is that if LivingDamageEvent.Pre elects to increase the damage taken, it will not be reflected in lastHurt. I suppose users should prefer LivingIncomingDamageEvent for that, however.

Closes #3201

@Shadows-of-Fire Shadows-of-Fire self-assigned this Jun 3, 2026
@neoforged-automation neoforged-automation Bot added the 26.1 Targeted at Minecraft 26.1 label Jun 3, 2026
@neoforged-pr-publishing
Copy link
Copy Markdown

  • Publish PR to GitHub Packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.1 Targeted at Minecraft 26.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Damage invulnerability capture wrong damage dealt

1 participant