Class EntityAttribute.Builder
java.lang.Object
me.gamercoder215.mobchip.ai.attribute.EntityAttribute.Builder
- Enclosing class:
EntityAttribute
Entity Attribute Builder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the EntityAttribute.setClientSide
(boolean clientSide) Sets whether the Attribute will appear on the client's side.setDefaultValue
(double defaultValue) Sets the Attribute's default value.setKey
(@NotNull NamespacedKey key) Sets the Attribute's NamespacedKey.setMaxValue
(double maxValue) Sets the Attribute's maximum value.setMinValue
(double minValue) Sets the Attribute's minimum value.
-
Method Details
-
setKey
Sets the Attribute's NamespacedKey.- Parameters:
key
- NamespacedKey- Returns:
- this builder, for chaining
-
setMinValue
Sets the Attribute's minimum value. Default: 1.0D- Parameters:
minValue
- Minimum value- Returns:
- this builder, for chaining
-
setDefaultValue
Sets the Attribute's default value. Default: 1.0D- Parameters:
defaultValue
- Default value- Returns:
- this builder, for chaining
-
setMaxValue
Sets the Attribute's maximum value. Default: 1024.0D- Parameters:
maxValue
- Maximum value- Returns:
- this builder, for chaining
-
setClientSide
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 negativeUnsupportedOperationException
- if this attribute already exists in the registry
-