Program: 34703
Project: 34703
Buggy source:
@Override public void onLivingUpdate(){
  if (isWet()) {
    attackEntityFrom(DamageSource.drown,1F);
  }
  isJumping=false;
  if (getAttackTarget() != null) {
    faceEntity(getAttackTarget(),100F,100F);
  }
  boolean hasIS=isCarrying();
  if (!worldObj.isRemote) {
    if (target == null) {
      if (!hasIS && !isScared && rand.nextInt(550) == 0) {
        List<EntityPlayer> list=worldObj.getEntitiesWithinAABB(EntityPlayer.class,boundingBox.expand(6D,3D,6D));
        if (!list.isEmpty()) {
          target=list.get(rand.nextInt(list.size()));
          ItemStack headArmor=target.getCurrentArmor(3);
          if (headArmor != null && headArmor.getItem() == ItemList.enderman_head)           target=null;
 else           attentionLossTimer=(byte)(64 + rand.nextInt(62));
        }
      }
 else {
        List<EntityItem> list=worldObj.getEntitiesWithinAABB(EntityItem.class,boundingBox.expand(1D,0D,1D));
        if (!list.isEmpty() && ++itemDecisionTimer > rand.nextInt(70) + 15) {
          int carryingLevelIndex=itemPriorities.indexOf(carryingLevel);
          EntityItem item=list.get(rand.nextInt(list.size()));
          ItemStack is=item.getEntityItem();
          for (          ItemPriorityLevel level : itemPriorities) {
            if (level.isValid(is)) {
              if (itemPriorities.indexOf(level) < carryingLevelIndex) {
                if (hasIS) {
                  EntityItem newItem=new EntityItem(worldObj,posX,posY,posZ,getCarrying());
                  float power=0.3F, yawRadians=(float)Math.toRadians(rotationYaw), randomAngle=rand.nextFloat() * (float)Math.PI * 2F;
                  newItem.motionX=(-MathHelper.sin(yawRadians) * MathHelper.cos(yawRadians) * power);
                  newItem.motionZ=(MathHelper.cos(yawRadians) * MathHelper.cos(yawRadians) * power);
                  newItem.motionY=(-MathHelper.sin((float)Math.toRadians(rotationPitch)) * power + 0.1F);
                  power=0.02F * rand.nextFloat();
                  newItem.motionX+=MathHelper.cos(randomAngle) * power;
                  newItem.motionY+=(rand.nextFloat() - rand.nextFloat()) * 0.1F;
                  newItem.motionZ+=MathHelper.sin(randomAngle) * power;
                  worldObj.spawnEntityInWorld(newItem);
                }
                setCarriedItemStack(is);
                item.setDead();
              }
              break;
            }
          }
          itemDecisionTimer=0;
        }
      }
    }
 else     if (target != null) {
      if (--attentionLossTimer < -124 || target.isDead)       target=null;
 else       if (!hasIS && getDistanceToEntity(target) < 1.8D) {
        for (int attempt=0, slot; attempt < 60; attempt++) {
          slot=rand.nextInt(target.inventory.mainInventory.length);
          if (slot == target.inventory.currentItem)           continue;
          ItemStack is=target.inventory.mainInventory[slot];
          if (is != null) {
            ItemStack carrying=is.copy();
            carrying.stackSize=1;
            setCarriedItemStack(carrying);
            if (--target.inventory.mainInventory[slot].stackSize == 0) {
              target.inventory.mainInventory[slot]=null;
              PacketPipeline.sendToPlayer(target,new C00ClearInventorySlot(slot));
            }
            break;
          }
        }
        PathEntity escapePath=null;
        BlockPosM pos=new BlockPosM();
        for (int pathatt=0; pathatt < 100; pathatt++) {
          double ang=rand.nextDouble() * 2D * Math.PI, len=8D + rand.nextDouble() * 6D;
          pos.moveTo(this).moveBy(MathUtil.floor(Math.cos(ang) * len),rand.nextInt(4) - 2,MathUtil.floor(Math.sin(ang) * len));
          Block low=pos.getBlock(worldObj);
          if ((low.getMaterial() == Material.air || low == BlockList.crossed_decoration) && pos.moveUp().isAir(worldObj)) {
            escapePath=worldObj.getEntityPathToXYZ(this,xx,yy,zz,16F,false,true,false,false);
            break;
          }
        }
        if (escapePath != null)         setPathToEntity(escapePath);
        target=null;
      }
    }
    setAttackTarget(target);
  }
  super.onLivingUpdate();
}

Fixed version (ground truth):
@Override public void onLivingUpdate(){
  if (isWet()) {
    attackEntityFrom(DamageSource.drown,1F);
  }
  isJumping=false;
  if (getAttackTarget() != null) {
    faceEntity(getAttackTarget(),100F,100F);
  }
  boolean hasIS=isCarrying();
  if (!worldObj.isRemote) {
    if (target == null) {
      if (!hasIS && !isScared && rand.nextInt(550) == 0) {
        List<EntityPlayer> list=worldObj.getEntitiesWithinAABB(EntityPlayer.class,boundingBox.expand(6D,3D,6D));
        if (!list.isEmpty()) {
          target=list.get(rand.nextInt(list.size()));
          ItemStack headArmor=target.getCurrentArmor(3);
          if (headArmor != null && headArmor.getItem() == ItemList.enderman_head)           target=null;
 else           attentionLossTimer=(byte)(64 + rand.nextInt(62));
        }
      }
 else {
        List<EntityItem> list=worldObj.getEntitiesWithinAABB(EntityItem.class,boundingBox.expand(1D,0D,1D));
        if (!list.isEmpty() && ++itemDecisionTimer > rand.nextInt(70) + 15) {
          int carryingLevelIndex=itemPriorities.indexOf(carryingLevel);
          EntityItem item=list.get(rand.nextInt(list.size()));
          ItemStack is=item.getEntityItem();
          for (          ItemPriorityLevel level : itemPriorities) {
            if (level.isValid(is)) {
              if (itemPriorities.indexOf(level) < carryingLevelIndex) {
                if (hasIS) {
                  EntityItem newItem=new EntityItem(worldObj,posX,posY,posZ,getCarrying());
                  float power=0.3F, yawRadians=(float)Math.toRadians(rotationYaw), randomAngle=rand.nextFloat() * (float)Math.PI * 2F;
                  newItem.motionX=(-MathHelper.sin(yawRadians) * MathHelper.cos(yawRadians) * power);
                  newItem.motionZ=(MathHelper.cos(yawRadians) * MathHelper.cos(yawRadians) * power);
                  newItem.motionY=(-MathHelper.sin((float)Math.toRadians(rotationPitch)) * power + 0.1F);
                  power=0.02F * rand.nextFloat();
                  newItem.motionX+=MathHelper.cos(randomAngle) * power;
                  newItem.motionY+=(rand.nextFloat() - rand.nextFloat()) * 0.1F;
                  newItem.motionZ+=MathHelper.sin(randomAngle) * power;
                  worldObj.spawnEntityInWorld(newItem);
                }
                setCarriedItemStack(is);
                item.setDead();
              }
              break;
            }
          }
          itemDecisionTimer=0;
        }
      }
    }
 else     if (target != null) {
      if (--attentionLossTimer < -124 || target.isDead)       target=null;
 else       if (!hasIS && getDistanceToEntity(target) < 1.8D) {
        for (int attempt=0, slot; attempt < 60; attempt++) {
          slot=rand.nextInt(target.inventory.mainInventory.length);
          if (slot == target.inventory.currentItem)           continue;
          ItemStack is=target.inventory.mainInventory[slot];
          if (is != null) {
            ItemStack carrying=is.copy();
            carrying.stackSize=1;
            setCarriedItemStack(carrying);
            if (--target.inventory.mainInventory[slot].stackSize == 0) {
              target.inventory.mainInventory[slot]=null;
              PacketPipeline.sendToPlayer(target,new C00ClearInventorySlot(slot));
            }
            break;
          }
        }
        PathEntity escapePath=null;
        BlockPosM pos=new BlockPosM();
        for (int pathatt=0; pathatt < 100; pathatt++) {
          double ang=rand.nextDouble() * 2D * Math.PI, len=8D + rand.nextDouble() * 6D;
          pos.moveTo(this).moveBy(MathUtil.floor(Math.cos(ang) * len),rand.nextInt(4) - 2,MathUtil.floor(Math.sin(ang) * len));
          Block low=pos.getBlock(worldObj);
          if ((low.getMaterial() == Material.air || low == BlockList.crossed_decoration) && pos.moveUp().isAir(worldObj)) {
            escapePath=navigator.getPathToXYZ(pos.x + 0.5D,pos.y,pos.z + 0.5D);
            break;
          }
        }
        if (escapePath != null)         navigator.setPath(escapePath,1D);
        target=null;
      }
    }
    setAttackTarget(target);
  }
  super.onLivingUpdate();
}