--- a/net/minecraft/world/entity/ai/goal/TemptGoal.java
+++ b/net/minecraft/world/entity/ai/goal/TemptGoal.java
@@ -3,14 +3,22 @@
 import java.util.EnumSet;
 import java.util.function.Predicate;
 import javax.annotation.Nullable;
+import net.minecraft.world.entity.Entity;
 import net.minecraft.world.entity.LivingEntity;
 import net.minecraft.world.entity.PathfinderMob;
 import net.minecraft.world.entity.ai.targeting.TargetingConditions;
-import net.minecraft.world.entity.player.Player;
 import net.minecraft.world.item.ItemStack;
 
+// 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 TemptGoal extends Goal {
-    private static final TargetingConditions TEMP_TARGETING = TargetingConditions.forNonCombat().range(10.0).ignoreLineOfSight();
+
+    private static final TargetingConditions TEMP_TARGETING = TargetingConditions.forNonCombat().range(10.0D).ignoreLineOfSight();
     private final TargetingConditions targetingConditions;
     protected final PathfinderMob mob;
     private final double speedModifier;
@@ -20,7 +28,7 @@
     private double pRotX;
     private double pRotY;
     @Nullable
-    protected Player player;
+    protected LivingEntity player; // CraftBukkit
     private int calmDown;
     private boolean isRunning;
     private final Predicate<ItemStack> items;
@@ -32,16 +40,25 @@
         this.items = foodPredicate;
         this.canScare = canBeScared;
         this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK));
-        this.targetingConditions = TEMP_TARGETING.copy().selector(this::shouldFollow);
+        this.targetingConditions = TemptGoal.TEMP_TARGETING.copy().selector(this::shouldFollow);
     }
 
     @Override
     public boolean canUse() {
         if (this.calmDown > 0) {
-            this.calmDown--;
+            --this.calmDown;
             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;
         }
     }
@@ -53,12 +70,12 @@
     @Override
     public boolean canContinueToUse() {
         if (this.canScare()) {
-            if (this.mob.distanceToSqr(this.player) < 36.0) {
-                if (this.player.distanceToSqr(this.px, this.py, this.pz) > 0.010000000000000002) {
+            if (this.mob.distanceToSqr((Entity) this.player) < 36.0D) {
+                if (this.player.distanceToSqr(this.px, this.py, this.pz) > 0.010000000000000002D) {
                     return false;
                 }
 
-                if (Math.abs((double)this.player.getXRot() - this.pRotX) > 5.0 || Math.abs((double)this.player.getYRot() - this.pRotY) > 5.0) {
+                if (Math.abs((double) this.player.getXRot() - this.pRotX) > 5.0D || Math.abs((double) this.player.getYRot() - this.pRotY) > 5.0D) {
                     return false;
                 }
             } else {
@@ -67,8 +84,8 @@
                 this.pz = this.player.getZ();
             }
 
-            this.pRotX = (double)this.player.getXRot();
-            this.pRotY = (double)this.player.getYRot();
+            this.pRotX = (double) this.player.getXRot();
+            this.pRotY = (double) this.player.getYRot();
         }
 
         return this.canUse();
@@ -96,12 +113,13 @@
 
     @Override
     public void tick() {
-        this.mob.getLookControl().setLookAt(this.player, (float)(this.mob.getMaxHeadYRot() + 20), (float)this.mob.getMaxHeadXRot());
-        if (this.mob.distanceToSqr(this.player) < 6.25) {
+        this.mob.getLookControl().setLookAt(this.player, (float) (this.mob.getMaxHeadYRot() + 20), (float) this.mob.getMaxHeadXRot());
+        if (this.mob.distanceToSqr((Entity) this.player) < 6.25D) {
             this.mob.getNavigation().stop();
         } else {
-            this.mob.getNavigation().moveTo(this.player, this.speedModifier);
+            this.mob.getNavigation().moveTo((Entity) this.player, this.speedModifier);
         }
+
     }
 
     public boolean isRunning() {
