Class WrappedAttribute.Builder

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

public static class WrappedAttribute.Builder extends Object
Represents a builder for wrapped attributes.

Use WrappedAttribute.newBuilder() to construct it.

  • Method Details

    • baseValue

      public WrappedAttribute.Builder baseValue(double baseValue)
      Change the base value of the attribute.

      The modifiers will automatically supply a value if this is unset.

      Parameters:
      baseValue - - the base value value.
      Returns:
      This builder, for chaining.
    • attributeKey

      public WrappedAttribute.Builder attributeKey(String attributeKey)
      Set the unique attribute key that identifies its function.

      This is required.

      Parameters:
      attributeKey - - the unique attribute key.
      Returns:
      This builder, for chaining.
    • modifiers

      Set the modifers that will be supplied to the client, and used to compute the final value.
      Parameters:
      modifiers - - the attribute modifiers.
      Returns:
      This builder, for chaining.
    • addModifier

      public WrappedAttribute.Builder addModifier(WrappedAttributeModifier modifier)
    • packet

      Deprecated.
      Removed in 1.17
      Set the parent update attributes packet (44).
      Parameters:
      packet - - the parent packet.
      Returns:
      This builder, for chaining.
    • build

      public WrappedAttribute build()
      Build a new wrapped attribute with the values of this builder.
      Returns:
      The wrapped attribute.
      Throws:
      RuntimeException - If anything went wrong with the reflection.