@Override
 protected void entityInit() {
   super.entityInit();
   dataWatcher.addObject(17, new Integer(0));
   dataWatcher.addObject(18, new Integer(-100));
   dataWatcher.addObject(19, new Integer(0));
   dataWatcher.addObject(20, new Short((short) 0));
   dataWatcher.addObject(21, new Integer(0));
 }
 @Override
 public void onUpdate() {
   super.onUpdate();
   int i = getEnergyAttackDuration();
   // if(targetedEntity != null)
   {
     // setTargetPosition((int)targetedEntity.posX, (int)targetedEntity.posY,
     // (int)targetedEntity.posZ);
     setAmpflyTarget(targetedEntity);
     if (i <= 0) {
       setEnergyAttackDuration((short) 0);
       if (targetedEntity != null
           && rand.nextInt(20) == 0
           && getDistanceToEntity(targetedEntity) < 16F
           && isCourseTraversable(targetedEntity.posX, targetedEntity.posY, targetedEntity.posZ)) {
         setEnergyAttackDuration((short) 1);
         setEnergyAttackLocation(
             (int) targetedEntity.posX, (int) targetedEntity.posY, (int) targetedEntity.posZ);
         isAttackCharging = true;
       }
     } else {
       int[] location = getEnergyAttackLocation();
       if (location != null) {
         performEnergyAttack(location[0], location[1], location[2], i / 4);
       }
       if (i >= 16) {
         isAttackCharging = false;
         // setEnergyAttackDuration((short)(i - 1));
       }
       if (isAttackCharging) {
         // short s = (short)(getEnergyAttackDuration() - 1);
         setEnergyAttackDuration((short) (i + 1));
       } else {
         setEnergyAttackDuration((short) (i - 1));
       }
     }
   }
   if (targetedEntity == null) {
     setAmpflyTarget(null);
     setEnergyAttackDuration((short) 0);
     // setTargetPosition(0, -100, 0);
   }
 }
 protected void applyEntityAttributes() {
   super.applyEntityAttributes();
   this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16D);
 }