Class EntityAttribute.Builder

java.lang.Object
me.gamercoder215.mobchip.ai.attribute.EntityAttribute.Builder
Enclosing class:
EntityAttribute

public static final class EntityAttribute.Builder extends Object
Entity Attribute Builder
  • Method Details

    • setKey

      Sets the Attribute's NamespacedKey.
      Parameters:
      key - NamespacedKey
      Returns:
      this builder, for chaining
    • setMinValue

      public EntityAttribute.Builder setMinValue(double minValue)
      Sets the Attribute's minimum value. Default: 1.0D
      Parameters:
      minValue - Minimum value
      Returns:
      this builder, for chaining
    • setDefaultValue

      public EntityAttribute.Builder setDefaultValue(double defaultValue)
      Sets the Attribute's default value. Default: 1.0D
      Parameters:
      defaultValue - Default value
      Returns:
      this builder, for chaining
    • setMaxValue

      public EntityAttribute.Builder setMaxValue(double maxValue)
      Sets the Attribute's maximum value. Default: 1024.0D
      Parameters:
      maxValue - Maximum value
      Returns:
      this builder, for chaining
    • setClientSide

      public EntityAttribute.Builder setClientSide(boolean clientSide)
      Sets whether the Attribute will appear on the client's side. Default: true

      Do not use this method unless you know what you are doing!
      Parameters:
      clientSide - Whether the Attribute will appear on the client's side
      Returns:
      this builder, for chaining
    • build

      Builds the EntityAttribute.
      Returns:
      Attribute Created
      Throws:
      IllegalArgumentException - if the operations don't make sense (e.g. min is greater than max), the key is null or a number is negative
      UnsupportedOperationException - if this attribute already exists in the registry