/** Called when the mob's health reaches 0. */ public void onDeath(DamageSource par1DamageSource) { if (this.villageObj != null) { Entity entity = par1DamageSource.getEntity(); if (entity != null) { if (entity instanceof EntityPlayer) { this.villageObj.setReputationForPlayer( ((EntityPlayer) entity).getCommandSenderName(), -2); } else if (entity instanceof IMob) { this.villageObj.endMatingSeason(); } } else if (entity == null) { EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 16.0D); if (entityplayer != null) { this.villageObj.endMatingSeason(); } } } super.onDeath(par1DamageSource); }