summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalHurtByTarget.patch
blob: 1e4a1a137e4b8a2f38cc9a2cbba5d0caab7c062a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- a/net/minecraft/server/PathfinderGoalHurtByTarget.java
+++ b/net/minecraft/server/PathfinderGoalHurtByTarget.java
@@ -24,7 +24,7 @@
     }
 
     public void c() {
-        this.e.setGoalTarget(this.e.getLastDamager());
+        this.e.setGoalTarget(this.e.getLastDamager(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason
         this.g = this.e.getGoalTarget();
         this.b = this.e.cg();
         this.h = 300;
@@ -66,6 +66,6 @@
     }
 
     protected void a(EntityCreature entitycreature, EntityLiving entityliving) {
-        entitycreature.setGoalTarget(entityliving);
+        entitycreature.setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, true); // CraftBukkit - reason
     }
 }