public void onLivingUpdate() {
   super.onLivingUpdate();
   field_21088_b = field_21089_a;
   field_21086_f = field_21087_c;
   field_21084_h = field_21085_g;
   lastTentacleAngle = tentacleAngle;
   field_21085_g += field_21080_l;
   if (field_21085_g > 6.283185F) {
     field_21085_g -= 6.283185F;
     if (rand.nextInt(10) == 0) {
       field_21080_l = (1.0F / (rand.nextFloat() + 1.0F)) * 0.2F;
     }
   }
   if (isInWater()) {
     if (field_21085_g < 3.141593F) {
       float f = field_21085_g / 3.141593F;
       tentacleAngle = MathHelper.sin(f * f * 3.141593F) * 3.141593F * 0.25F;
       if ((double) f > 0.75D) {
         randomMotionSpeed = 1.0F;
         field_21079_m = 1.0F;
       } else {
         field_21079_m = field_21079_m * 0.8F;
       }
     } else {
       tentacleAngle = 0.0F;
       randomMotionSpeed = randomMotionSpeed * 0.9F;
       field_21079_m = field_21079_m * 0.99F;
     }
     if (!worldObj.multiplayerWorld) {
       motionX = randomMotionVecX * randomMotionSpeed;
       motionY = randomMotionVecY * randomMotionSpeed;
       motionZ = randomMotionVecZ * randomMotionSpeed;
     }
     float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
     renderYawOffset +=
         ((-(float) Math.atan2(motionX, motionZ) * 180F) / 3.141593F - renderYawOffset) * 0.1F;
     rotationYaw = renderYawOffset;
     field_21087_c = field_21087_c + 3.141593F * field_21079_m * 1.5F;
     field_21089_a +=
         ((-(float) Math.atan2(f1, motionY) * 180F) / 3.141593F - field_21089_a) * 0.1F;
   } else {
     tentacleAngle = MathHelper.abs(MathHelper.sin(field_21085_g)) * 3.141593F * 0.25F;
     if (!worldObj.multiplayerWorld) {
       motionX = 0.0D;
       motionY -= 0.080000000000000002D;
       motionY *= 0.98000001907348633D;
       motionZ = 0.0D;
     }
     field_21089_a += (double) (-90F - field_21089_a) * 0.02D;
   }
 }
 public void readEntityFromNBT(NBTTagCompound nbttagcompound) {
   super.readEntityFromNBT(nbttagcompound);
 }
 protected void fall(float f) {
   if (!inWater) {
     super.fall(f);
   }
 }
 public void writeEntityToNBT(NBTTagCompound nbttagcompound) {
   super.writeEntityToNBT(nbttagcompound);
 }
  protected void updatePlayerActionState() {
    if (riddenByEntity != null && tamed) {
      return;
    }
    hasAttacked = false;
    float f = 16F;
    if (playerToAttack == null) {
      playerToAttack = findPlayerToAttack();
      if (playerToAttack != null && playerToAttack.inWater) {
        a = worldObj.getPathToEntity(this, playerToAttack, f);
      }
    } else if (!playerToAttack.isEntityAlive() || !playerToAttack.inWater) {
      playerToAttack = null;
    } else {
      float f1 = playerToAttack.getDistanceToEntity(this);
      if (canEntityBeSeen(playerToAttack)) {
        attackEntity(playerToAttack, f1);
      }
    }
    if (!hasAttacked
        && playerToAttack != null
        && playerToAttack.inWater
        && (a == null || rand.nextInt(20) == 0)) {
      a = worldObj.getPathToEntity(this, playerToAttack, f);
    } else if (a == null && rand.nextInt(80) == 0 || rand.nextInt(80) == 0) {
      boolean flag = false;
      int j = -1;
      int k = -1;
      int l = -1;
      float f2 = -99999F;
      for (int i1 = 0; i1 < 10; i1++) {
        int j1 = MathHelper.floor_double((posX + (double) rand.nextInt(13)) - 6D);
        int k1 = MathHelper.floor_double((posY + (double) rand.nextInt(7)) - 3D);
        int l1 = MathHelper.floor_double((posZ + (double) rand.nextInt(13)) - 6D);
        float f3 = getBlockPathWeight(j1, k1, l1);
        if (f3 > f2) {
          f2 = f3;
          j = j1;
          k = k1;
          l = l1;
          flag = true;
        }
      }

      if (flag) {
        a = worldObj.getEntityPathToXYZ(this, j, k, l, 10F);
      }
    }
    int i = MathHelper.floor_double(boundingBox.minY);
    boolean flag1 = handleWaterMovement();
    boolean flag2 = handleLavaMovement();
    rotationPitch = 0.0F;
    if (a == null || rand.nextInt(100) == 0) {
      super.updatePlayerActionState();
      a = null;
      return;
    }
    Vec3D vec3d = a.getPosition(this);
    for (double d = width * 2.0F;
        vec3d != null && vec3d.squareDistanceTo(posX, vec3d.yCoord, posZ) < d * d; ) {
      a.incrementPathIndex();
      if (a.isFinished()) {
        vec3d = null;
        a = null;
      } else {
        vec3d = a.getPosition(this);
      }
    }

    isJumping = false;
    if (vec3d != null) {
      double d1 = vec3d.xCoord - posX;
      double d2 = vec3d.zCoord - posZ;
      double d3 = vec3d.yCoord - (double) i;
      float f4 = (float) ((Math.atan2(d2, d1) * 180D) / 3.1415927410125728D) - 90F;
      float f5 = f4 - rotationYaw;
      moveForward = moveSpeed;
      for (; f5 < -180F; f5 += 360F) {}
      for (; f5 >= 180F; f5 -= 360F) {}
      if (f5 > 30F) {
        f5 = 30F;
      }
      if (f5 < -30F) {
        f5 = -30F;
      }
      rotationYaw += f5;
      if (hasAttacked && playerToAttack != null) {
        double d4 = playerToAttack.posX - posX;
        double d5 = playerToAttack.posZ - posZ;
        float f6 = rotationYaw;
        rotationYaw = (float) ((Math.atan2(d5, d4) * 180D) / 3.1415927410125728D) - 90F;
        float f7 = (((f6 - rotationYaw) + 90F) * 3.141593F) / 180F;
        moveStrafing = -MathHelper.sin(f7) * moveForward * 1.0F;
        moveForward = MathHelper.cos(f7) * moveForward * 1.0F;
      }
      if (d3 > 0.0D && playerToAttack != null && playerToAttack.inWater) {
        isJumping = true;
      }
    }
    if (playerToAttack != null) {
      faceEntity(playerToAttack, 30F, 30F);
    }
    if (isCollidedHorizontally) {
      isJumping = true;
    }
    if (rand.nextFloat() < 0.8F && (flag1 || flag2)) {
      isJumping = true;
    }
  }