Interface AttributeModifier
- All Superinterfaces:
Keyed,ResourceKeyed
Represents a modifier to a value in a
Attribute which is transformed
by an AttributeOperation.
Modifiers are usually found on ItemStacks.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a builder class to createAttributeModifiers. -
Method Summary
Modifier and TypeMethodDescriptiondoubleamount()Gets the amount this attribute will be modified by.static AttributeModifier.Builderbuilder()Creates a newAttributeModifier.Builderto create anAttributeModifier.static AttributeModifierof(ResourceKey key, Supplier<? extends AttributeOperation> operation, double amount) Creates an attribute modifier with the given values.static AttributeModifierof(ResourceKey key, AttributeOperation operation, double amount) Creates an attribute modifier with the given values.Gets this modifier's operation.Methods inherited from interface org.spongepowered.api.ResourceKeyed
key
-
Method Details
-
of
static AttributeModifier of(ResourceKey key, Supplier<? extends AttributeOperation> operation, double amount) Creates an attribute modifier with the given values.- Parameters:
key- The resource keyoperation- The attribute operationamount- The amount- Returns:
- The attribute modifier
-
of
Creates an attribute modifier with the given values.- Parameters:
key- The resource keyoperation- The attribute operationamount- The amount- Returns:
- The attribute modifier
-
builder
Creates a newAttributeModifier.Builderto create anAttributeModifier.- Returns:
- The new builder
-
operation
AttributeOperation operation()Gets this modifier's operation.- Returns:
- The operation
-
amount
double amount()Gets the amount this attribute will be modified by.- Returns:
- The amount
-