--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
@@ -11,6 +11,10 @@
 import net.minecraft.world.level.pathfinder.PathPoint;
 import net.minecraft.world.scores.ScoreboardTeam;
 
+// CraftBukkit start
+import org.bukkit.event.entity.EntityTargetEvent;
+// CraftBukkit end
+
 public abstract class PathfinderGoalTarget extends PathfinderGoal {
 
     private static final int EMPTY_REACH_CACHE = 0;
@@ -69,7 +73,7 @@
                         }
                     }
 
-                    this.mob.setTarget(entityliving);
+                    this.mob.setTarget(entityliving, EntityTargetEvent.TargetReason.CLOSEST_ENTITY, true); // CraftBukkit
                     return true;
                 }
             }
@@ -89,7 +93,7 @@
 
     @Override
     public void stop() {
-        this.mob.setTarget((EntityLiving) null);
+        this.mob.setTarget((EntityLiving) null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit
         this.targetMob = null;
     }
 
