use of net.minecraft.entity.ai.attributes.AttributeModifier in project Tropicraft by Tropicraft.
the class ItemDagger method getAttributeModifiers.
/**
* Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
*/
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(slot, stack);
if (slot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) this.toolMaterial.getAttackDamage() + 2.5D, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", 0D, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Cavern2 by kegare.
the class ItemSwordCavenic method getAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> map = super.getAttributeModifiers(slot, stack);
if (slot == EntityEquipmentSlot.MAINHAND) {
map.removeAll(SharedMonsterAttributes.ATTACK_SPEED.getName());
map.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -1.0000000953674316D, 0));
}
return map;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project ClaySoldiersMod by SanAndreasP.
the class UpgradeShearBlade method onAttackSuccess.
@Override
public void onAttackSuccess(ISoldier<?> soldier, ISoldierUpgradeInst upgradeInst, Entity target) {
NBTTagCompound nbt = upgradeInst.getNbtData();
if (nbt.getBoolean("firstHit")) {
this.resetFirstHit(soldier, upgradeInst);
ClaySoldiersMod.proxy.spawnParticle(EnumParticle.CRITICAL, target.world.provider.getDimension(), target.posX, target.posY + target.getEyeHeight(), target.posZ);
}
byte uses = (byte) (nbt.getByte("uses") - 1);
if (uses < 1) {
AttributeModifier modifier = upgradeInst.getUpgradeType() == EnumUpgradeType.MAIN_HAND ? BLADE_DMG_1 : BLADE_DMG_2;
soldier.getEntity().getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).removeModifier(modifier);
soldier.destroyUpgrade(upgradeInst.getUpgrade(), upgradeInst.getUpgradeType(), false);
soldier.getEntity().playSound(SoundEvents.ENTITY_ITEM_BREAK, 0.8F, 0.8F + MiscUtils.RNG.randomFloat() * 0.4F);
} else {
nbt.setByte("uses", uses);
}
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class ItemATHammer method getAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", (double) 9.0F + this.getAttackDamage(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) -3.5F, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class ItemATHoe method getAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 0.0F, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double) -(3.0 - this.getHarvestLevel(stack)), 0));
}
return multimap;
}
Aggregations