use of net.minecraft.entity.ai.attributes.AttributeModifier in project Galacticraft by micdoodle8.
the class ItemSwordAsteroids method getItemAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", this.attackDamageD, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.8D, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project EnderIO by SleepyTrousers.
the class ItemDarkSteelSword method getAttributeModifiers.
@Override
@Nonnull
public Multimap<String, AttributeModifier> getAttributeModifiers(@Nonnull EntityEquipmentSlot equipmentSlot, @Nonnull ItemStack stack) {
Multimap<String, AttributeModifier> res = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
if (Config.darkSteelSwordPowerUsePerHit <= 0 || EnergyUpgradeManager.getEnergyStored(stack) >= Config.darkSteelSwordPowerUsePerHit) {
EnergyUpgrade energyUpgrade = EnergyUpgrade.loadAnyFromItem(stack);
int level = energyUpgrade.getLevel();
res.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), DarkSteelAttributeModifiers.getAttackDamage(level));
res.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), DarkSteelAttributeModifiers.getAttackSpeed(level));
}
}
return res;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project EnderIO by SleepyTrousers.
the class SpeedController method clearModifiers.
private static boolean clearModifiers(@Nonnull EntityPlayer player) {
IAttributeInstance moveInst = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.MOVEMENT_SPEED);
UUID uuid = DarkSteelAttributeModifiers.getWalkSpeed(false, 1, 0).getID();
AttributeModifier modifier = moveInst.getModifier(uuid);
if (modifier != null) {
moveInst.removeModifier(modifier);
return true;
}
return false;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Bewitchment by Um-Mitternacht.
the class VampireAbilityHandler method refreshModifiers.
@SubscribeEvent
public void refreshModifiers(TransformationModifiedEvent evt) {
ITransformationData data = evt.getEntityPlayer().getCapability(CapabilityTransformationData.CAPABILITY, null);
IAttributeInstance attack_speed = evt.getEntityPlayer().getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED);
AttributeModifier modifier = attack_speed.getModifier(ATTACK_SPEED_MODIFIER_UUID);
if (modifier != null) {
attack_speed.removeModifier(modifier);
}
if (data.getType() == ModTransformations.VAMPIRE) {
attack_speed.applyModifier(new AttributeModifier(ATTACK_SPEED_MODIFIER_UUID, "Vampire Atk Speed", evt.level / 10, 0));
}
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Bewitchment by Um-Mitternacht.
the class BrewAttributeModifier method register.
protected BrewAttributeModifier register(IAttribute attribute, String uuid, double ammount, int operation) {
AttributeModifier attributemodifier = new AttributeModifier(UUID.fromString(uuid), getName(), ammount, operation);
modifierMap.put(attribute, attributemodifier);
return this;
}
Aggregations