Skip to content

Commit

Permalink
Fix wolves ignoring result of damage event (#11932)
Browse files Browse the repository at this point in the history
  • Loading branch information
Warriorrrr authored Jan 8, 2025
1 parent 49d15f6 commit b34ae4f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
+ public boolean actuallyHurt(ServerLevel level, DamageSource damageSource, float amount, org.bukkit.event.entity.EntityDamageEvent event) { // CraftBukkit - void -> boolean
if (!this.canArmorAbsorb(damageSource)) {
- super.actuallyHurt(level, damageSource, amount);
+ super.actuallyHurt(level, damageSource, amount, event); // CraftBukkit
+ return super.actuallyHurt(level, damageSource, amount, event); // CraftBukkit
} else {
+ if (event.isCancelled()) return false; // CraftBukkit - SPIGOT-7815: if the damage was cancelled, no need to run the wolf armor behaviour
ItemStack bodyArmorItem = this.getBodyArmorItem();
Expand Down

0 comments on commit b34ae4f

Please sign in to comment.