Package net.minecraft.entity.ai.attributes

Examples of net.minecraft.entity.ai.attributes.IAttributeInstance.applyModifier()


      IAttributeInstance attackInst = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.attackDamage);
      attackInst.removeModifier(swordDamageModifierPowered);

      ItemStack sword = player.getCurrentEquippedItem();
      if(Config.darkSteelSwordPowerUsePerHit <= 0 || EnderIO.itemDarkSteelSword.getEnergyStored(sword) >= Config.darkSteelSwordPowerUsePerHit) {
        attackInst.applyModifier(swordDamageModifierPowered);
      }
    }
  }

  private void updateSpeed(EntityPlayer player) {
View Full Code Here


      int totalEnergy = getPlayerEnergy(player, EnderIO.itemDarkSteelLeggings);

      if(totalEnergy > 0) {
        usePlayerEnergy(player, EnderIO.itemDarkSteelLeggings, cost);
        if(player.isSprinting()) {
          moveInst.applyModifier(sprintModifiers[speedUpgrade.level - 1]);
        } else {
          moveInst.applyModifier(walkModifiers[speedUpgrade.level - 1]);
        }
      }
    }
View Full Code Here

      if(totalEnergy > 0) {
        usePlayerEnergy(player, EnderIO.itemDarkSteelLeggings, cost);
        if(player.isSprinting()) {
          moveInst.applyModifier(sprintModifiers[speedUpgrade.level - 1]);
        } else {
          moveInst.applyModifier(walkModifiers[speedUpgrade.level - 1]);
        }
      }
    }
  }
View Full Code Here

      if(horse.getHorseType() != 3 && horse.getHorseType() != 4 && horse.isTame()) {
        horse.setHorseType(3 + par1ItemStack.getItemDamage());
        BaseAttributeMap attributes = horse.getAttributeMap();
        IAttributeInstance movementSpeed = attributes.getAttributeInstance(SharedMonsterAttributes.movementSpeed);
        IAttributeInstance health = attributes.getAttributeInstance(SharedMonsterAttributes.maxHealth);
        health.applyModifier(new AttributeModifier("Ermergerd Virus D:", health.getBaseValue(), 0));
        movementSpeed.applyModifier(new AttributeModifier("Ermergerd Virus D:", movementSpeed.getBaseValue(), 0));
        IAttributeInstance jumpHeight = attributes.getAttributeInstance(ReflectionHelper.<IAttribute, EntityHorse>getPrivateValue(EntityHorse.class, null, LibObfuscation.HORSE_JUMP_STRENGTH));
        jumpHeight.applyModifier(new AttributeModifier("Ermergerd Virus D:", jumpHeight.getBaseValue() * 0.5, 0));
        par2EntityPlayer.worldObj.playSound(par3EntityLivingBase.posX + 0.5D, par3EntityLivingBase.posY + 0.5D, par3EntityLivingBase.posZ + 0.5D, "mob.zombie.remedy", 1.0F + par3EntityLivingBase.worldObj.rand.nextFloat(), par3EntityLivingBase.worldObj.rand.nextFloat() * 0.7F + 1.3F, false);

View Full Code Here

        IAttributeInstance movementSpeed = attributes.getAttributeInstance(SharedMonsterAttributes.movementSpeed);
        IAttributeInstance health = attributes.getAttributeInstance(SharedMonsterAttributes.maxHealth);
        health.applyModifier(new AttributeModifier("Ermergerd Virus D:", health.getBaseValue(), 0));
        movementSpeed.applyModifier(new AttributeModifier("Ermergerd Virus D:", movementSpeed.getBaseValue(), 0));
        IAttributeInstance jumpHeight = attributes.getAttributeInstance(ReflectionHelper.<IAttribute, EntityHorse>getPrivateValue(EntityHorse.class, null, LibObfuscation.HORSE_JUMP_STRENGTH));
        jumpHeight.applyModifier(new AttributeModifier("Ermergerd Virus D:", jumpHeight.getBaseValue() * 0.5, 0));
        par2EntityPlayer.worldObj.playSound(par3EntityLivingBase.posX + 0.5D, par3EntityLivingBase.posY + 0.5D, par3EntityLivingBase.posZ + 0.5D, "mob.zombie.remedy", 1.0F + par3EntityLivingBase.worldObj.rand.nextFloat(), par3EntityLivingBase.worldObj.rand.nextFloat() * 0.7F + 1.3F, false);

        par1ItemStack.stackSize--;
        return true;
      }
View Full Code Here

            IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
            iattributeinstance.removeModifier(babySpeedBoostModifier);

            if (isChild)
            {
                iattributeinstance.applyModifier(babySpeedBoostModifier);
            }
        }

        this.setChildSize(isChild);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.