use of net.minecraft.entity.ai.attributes.AttributeModifier in project Gaia-Dimension by Andromander.
the class GDZirconPrinceSword method getItemAttributeModifiers.
// TODO: Make this sword have lightning projectiles, reducing durability by 3
// TODO: [FUTURE] Can be used to unlock Unknown Goldstone Structure
// We will need this in order to make the weapon slow
@Override
@Nonnull
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
// This is not our speed anymore
multimap.removeAll(SharedMonsterAttributes.ATTACK_SPEED.getName());
// Speed is set to 1; 0.6 less than normal
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.3, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Charset by CharsetMC.
the class ItemUtils method getAttributeValue.
public static double getAttributeValue(EntityEquipmentSlot slot, ItemStack is, IAttribute attr) {
Multimap<String, AttributeModifier> attrs = is.getItem().getAttributeModifiers(slot, is);
if (attrs != null) {
AttributeMap map = new AttributeMap();
map.applyAttributeModifiers(attrs);
IAttributeInstance instance = map.getAttributeInstance(attr);
if (instance != null) {
return instance.getAttributeValue();
}
}
return 0;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Galacticraft by micdoodle8.
the class ItemSwordAsteroids method getItemAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getItemAttributeModifiers() {
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Weapon modifier", this.attackDamageD, 0));
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project CompositeGear by TwilightWingsStudio.
the class ItemCGMelee method getAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
double speedModifier = SWORD_SPEED_MODIFIER;
// TODO: Fix this stupid check in future.
if (stack.getItem() == ItemsCG.compositeDagger) {
speedModifier = DAGGER_SPEED_MODIFIER;
}
if (stack.getItem() == ItemsCG.compositeMace) {
speedModifier = MACE_SPEED_MODIFIER;
}
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 3.0D + (double) this.getAttackDamage(), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", speedModifier, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Bewitchment by Um-Mitternacht.
the class BrewAttributeModifier method removeAttributeModifiers.
public void removeAttributeModifiers(AbstractAttributeMap attributeMapIn, int amplifier) {
for (Map.Entry<IAttribute, AttributeModifier> entry : modifierMap.entrySet()) {
IAttributeInstance attribute = attributeMapIn.getAttributeInstance(entry.getKey());
if (attribute == null)
continue;
attribute.removeModifier(entry.getValue());
}
}
Aggregations