--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java
@@ -124,6 +124,7 @@
     public void func_70624_b(EntityLivingBase p_70624_1_)
     {
         this.field_70696_bz = p_70624_1_;
+        net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_);
     }
 
     public boolean func_70686_a(Class p_70686_1_)
@@ -507,10 +508,22 @@
 
     protected void func_70623_bb()
     {
+        net.minecraftforge.fml.common.eventhandler.Event.Result result = null;
         if (this.field_82179_bU)
         {
             this.field_70708_bq = 0;
         }
+        else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = net.minecraftforge.event.ForgeEventFactory.canEntityDespawn(this)) != net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT)
+        {
+            if (result == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY)
+            {
+                this.field_70708_bq = 0;
+            }
+            else
+            {
+                this.func_70106_y();
+            }
+        }
         else
         {
             EntityPlayer entityplayer = this.field_70170_p.func_72890_a(this, -1.0D);
@@ -628,7 +641,6 @@
         return this.field_70170_p.func_72917_a(this.func_174813_aQ(), this) && this.field_70170_p.func_72945_a(this, this.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(this.func_174813_aQ());
     }
 
-    @SideOnly(Side.CLIENT)
     public float func_70603_bj()
     {
         return 1.0F;
