Package com.comphenix.protocol.wrappers
Class WrappedAttributeModifier.Builder
java.lang.Object
com.comphenix.protocol.wrappers.WrappedAttributeModifier.Builder
- Enclosing class:
WrappedAttributeModifier
Represents a builder of attribute modifiers.
Use WrappedAttributeModifier.newBuilder() to construct an instance of the builder.
-
Method Summary
Modifier and TypeMethodDescriptionamount(double amount) Set the amount to modify in the operation.build()Construct a new attribute modifier and its wrapper using the supplied values in this builder.key(MinecraftKey key) Deprecated.operation(WrappedAttributeModifier.Operation operation) Set the operation that is used to compute the final attribute value.Deprecated.
-
Method Details
-
uuid
Deprecated.Set the unique UUID that identifies the origin of this modifier.This parameter is automatically supplied with a random UUID, or the UUID from an attribute modifier to clone.
- Parameters:
uuid- - the uuid to supply to the new object.- Returns:
- This builder, for chaining.
-
operation
public WrappedAttributeModifier.Builder operation(@Nonnull WrappedAttributeModifier.Operation operation) Set the operation that is used to compute the final attribute value.- Parameters:
operation- - the operation to supply to the new object.- Returns:
- This builder, for chaining.
-
name
Deprecated.Set a human readable name of this modifier.- Parameters:
name- - the name of the modifier.- Returns:
- This builder, for chaining.
-
key
-
key
-
amount
Set the amount to modify in the operation.- Parameters:
amount- - the amount to supply to the new object.- Returns:
- This builder, for chaining.
-
build
Construct a new attribute modifier and its wrapper using the supplied values in this builder.- Returns:
- The new attribute modifier.
- Throws:
NullPointerException- If UUID has not been set.RuntimeException- If we are unable to construct the underlying attribute modifier.
-