summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalTarget.patch
blob: acab1523a374e905db57938877d587fdeb867514 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- a/net/minecraft/server/PathfinderGoalTarget.java
+++ b/net/minecraft/server/PathfinderGoalTarget.java
@@ -1,6 +1,7 @@
 package net.minecraft.server;
 
 import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
 
 public abstract class PathfinderGoalTarget extends PathfinderGoal {
 
@@ -58,7 +59,7 @@
                     if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) {
                         return false;
                     } else {
-                        this.e.setGoalTarget(entityliving);
+                        this.e.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.CLOSEST_ENTITY, true); // CraftBukkit
                         return true;
                     }
                 }
@@ -79,7 +80,7 @@
     }
 
     public void d() {
-        this.e.setGoalTarget((EntityLiving) null);
+        this.e.setGoalTarget((EntityLiving) null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit
         this.g = null;
     }