use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class ItemATPickaxe 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) 1.0F + this.getAttackDamage(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) -2.8F, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class ItemATHandpick 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) 0.5F + this.getAttackDamage(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) -2.6F, 0));
multimap.put(EntityPlayer.REACH_DISTANCE.getName(), new AttributeModifier(BLOCK_REACH_MODIFIER, "Tool modifier", (double) -1F, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class ItemATMace 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", (double) 3.5F + this.getAttackDamage(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.6D, 0));
}
return multimap;
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class SpecialToolAbilityHandler method onToolSwitch.
@SubscribeEvent
public void onToolSwitch(LivingEquipmentChangeEvent event) {
if (event.getEntityLiving() instanceof EntityPlayer) {
if (event.getSlot() == EntityEquipmentSlot.MAINHAND) {
ItemStack from = event.getFrom();
ItemStack to = event.getTo();
if (isEnderPearlTool(from)) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
multimap.put(EntityPlayer.REACH_DISTANCE.getName(), enderPearlReachModifier);
event.getEntityLiving().getAttributeMap().removeAttributeModifiers(multimap);
}
if (isEnderPearlTool(to)) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
multimap.put(EntityPlayer.REACH_DISTANCE.getName(), enderPearlReachModifier);
event.getEntityLiving().getAttributeMap().applyAttributeModifiers(multimap);
}
}
}
}
use of net.minecraft.entity.ai.attributes.AttributeModifier in project Adventurers-Toolbox by the-realest-stu.
the class ItemRock method getAttributeModifiers.
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) 3.0F, 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double) -3F, 0));
}
return multimap;
}
Aggregations