Search in sources :

Example 16 with AttributeModifier

use of net.minecraft.entity.ai.attributes.AttributeModifier in project Skree by Skelril.

the class ICustomSword method getItemAttributeModifiers.

/**
     * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
     */
@SuppressWarnings("unchecked")
default default Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
    Multimap<String, AttributeModifier> multimap = __superGetItemAttributeModifiers(equipmentSlot);
    if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", __getHitPower(), 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", __getAttackSpeed(), 0));
    }
    return multimap;
}
Also used : AttributeModifier(net.minecraft.entity.ai.attributes.AttributeModifier)

Aggregations

AttributeModifier (net.minecraft.entity.ai.attributes.AttributeModifier)16 Multimap (com.google.common.collect.Multimap)4 IAttribute (net.minecraft.entity.ai.attributes.IAttribute)3 IAttributeInstance (net.minecraft.entity.ai.attributes.IAttributeInstance)3 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Collection (java.util.Collection)1 Iterator (java.util.Iterator)1 Nonnull (javax.annotation.Nonnull)1 IEntityLivingData (net.minecraft.entity.IEntityLivingData)1 ModifiableAttributeInstance (net.minecraft.entity.ai.attributes.ModifiableAttributeInstance)1 ItemStack (net.minecraft.item.ItemStack)1 Potion (net.minecraft.potion.Potion)1 PotionEffect (net.minecraft.potion.PotionEffect)1 Tuple (net.minecraft.util.Tuple)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1