#ElgarL teaches Cj stuff
1 messages · Page 1 of 1 (latest)
so if you were using the top one, String, double, AttributeModifier.Operation
its asking for three arguments
whats an enum
^
so if you use AttributeModifier.Operation.ADD_NUMBER in the previous constructor
it tells teh attribute to add yoru value to any damage
an Enum is, um, a set of constants (ish)
so a list of constants
its quite complex to excplain enums
k
basically for this instance this enum has three values
k
ADD_NUMBER, ADD_SCALAR and MULTIPLY_SCALAR_1
these ADD_NUMBER ADD_SCALAR MULTIPLY_SCALAR_1?
k
so going back to the AttributeModifier constructor AttributeModifier(String name, double amount, AttributeModifier.Operation operation)
you would be doing something like java new AttributeModifier("extra_damage", 10, AttributeModifier.Operation.ADD_NUMBER)
you plug that into your earlier addAttributeModifier method
so so what do I put in the first thing tell me what its called
addAttributeModifier(GENERIC_ATTACK_DAMAGE, new AttributeModifier("extra_damage", 10, AttributeModifier.Operation.ADD_NUMBER))```
ok thanks so much for your patience with a dummy
wait
@fringe shadow
in meta.addAttributeModifier(GENERIC_ATTACK_DAMAGE, new AttributeModifier("extra_damage", 10, AttributeModifier.Operation.ADD_NUMBER));
GENERIC_ATTACK_DAMAGE is throwing an error
you may have to get the attribute first. One sec I'll check
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("extra_damage", 10, AttributeModifier.Operation.ADD_NUMBER));```
thanks