[SPIGOT-7732] Issue with the "hurt()" method of EntityLiving Created: 07/Jun/24 Updated: 25/Dec/24 Resolved: 22/Jun/24 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Kami Rori | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Version: | This server is running CraftBukkit version 4149-Spigot-e2c1eee-4e7d749 (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT) |
| Guidelines Read: | Yes |
| Description |
|
f = originalDamage; /* damage modifications */ if ( ! invulnerable ) { if ( f <= this.lastHurt ) return false; this.actuallyHurt(damagesource, f - this.lastHurt); this.lastHurt = f; this.hurtEffect = false; } else { this.lastHurt = f; this.invulnerableTime = 20; this.actuallyHurt(damagesource, f); this.hurtDuration = 10; this.hurtTime = this.hurtDuration; } In this section, you can see that f is the damage value. Vanilla changes the value of f directly after the damage modification. spigot's damageModifier correctly calculates the final damage value, but spigot does not change the value of f. As a result, during the invulnerable time, the behavior that was supposed to compare the original damage value to determine whether the actual damage was caused was incorrectly modified to compare the final damage value. |