--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
@@ -9,6 +9,13 @@
 import net.minecraft.world.entity.player.EntityHuman;
 import net.minecraft.world.item.crafting.RecipeItemStack;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent;
+import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
+// CraftBukkit end
+
 public class PathfinderGoalTempt extends PathfinderGoal {
 
     private static final PathfinderTargetCondition TEMP_TARGETING = PathfinderTargetCondition.forNonCombat().range(10.0D).ignoreLineOfSight();
@@ -21,7 +28,7 @@
     private double pRotX;
     private double pRotY;
     @Nullable
-    protected EntityHuman player;
+    protected EntityLiving player; // CraftBukkit
     private int calmDown;
     private boolean isRunning;
     private final RecipeItemStack items;
@@ -43,6 +50,15 @@
             return false;
         } else {
             this.player = this.mob.level().getNearestPlayer(this.targetingConditions, this.mob);
+            // CraftBukkit start
+            if (this.player != null) {
+                EntityTargetLivingEntityEvent event = CraftEventFactory.callEntityTargetLivingEvent(this.mob, this.player, EntityTargetEvent.TargetReason.TEMPT);
+                if (event.isCancelled()) {
+                    return false;
+                }
+                this.player = (event.getTarget() == null) ? null : ((CraftLivingEntity) event.getTarget()).getHandle();
+            }
+            // CraftBukkit end
             return this.player != null;
         }
     }
