diff --git a/patches/server/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch b/patches/server/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch index 6d5627f0fb..88d87428c2 100644 --- a/patches/server/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch +++ b/patches/server/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch @@ -36,13 +36,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - protected void clearAttackTarget(E entity) { -+ protected void clearAttackTarget(E e0, EntityTargetEvent.TargetReason reason) { ++ protected void clearAttackTarget(E entity, EntityTargetEvent.TargetReason reason) { // CraftBukkit start - LivingEntity old = entity.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); - EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(entity, null, (old != null && !old.isAlive()) ? EntityTargetEvent.TargetReason.TARGET_DIED : EntityTargetEvent.TargetReason.FORGOT_TARGET); + // Paper start - fix this event + //EntityLiving old = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); -+ EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, null, reason); ++ EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(entity, null, reason); if (event.isCancelled()) { return; } @@ -56,8 +56,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + }*/ + // Paper end // CraftBukkit end -- this.onTargetErased.accept(entity); -- entity.getBrain().eraseMemory(MemoryModuleType.ATTACK_TARGET); -+ this.onTargetErased.accept(e0); - } - } + this.onTargetErased.accept(entity); + entity.getBrain().eraseMemory(MemoryModuleType.ATTACK_TARGET);