Class WrappedAttributeModifier.Builder

java.lang.Object
com.comphenix.protocol.wrappers.WrappedAttributeModifier.Builder
Enclosing class:
WrappedAttributeModifier

public static class WrappedAttributeModifier.Builder extends Object
Represents a builder of attribute modifiers.

Use WrappedAttributeModifier.newBuilder() to construct an instance of the builder.

Author:
Kristian
  • Method Details

    • uuid

      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

      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

      Set a human readable name of this modifier.
      Parameters:
      name - - the name of the modifier.
      Returns:
      This builder, for chaining.
    • amount

      public WrappedAttributeModifier.Builder amount(double 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

      public WrappedAttributeModifier 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.