Interface Attribute
- 
 public interface AttributeRepresents an instance of anAttributeTypethat contains a value.Attributes are held in an AttributeHolderAttributes can have AttributeModifiers applied to an entity through an equippedItemStack
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddModifier(AttributeModifier modifier)Adds a modifier to this attribute.doublebaseValue()Gets the base value of this attribute.booleanhasModifier(AttributeModifier modifier)Checks if this attribute has the provided modifier.java.util.Optional<AttributeModifier>modifier(java.util.UUID uniqueId)Gets an attribute modifier by its unique id.java.util.Collection<AttributeModifier>modifiers()Gets a collection of all applied modifiers.default java.util.Collection<AttributeModifier>modifiers(java.util.function.Supplier<? extends AttributeOperation> operation)Gets a collection of applied modifiers with the provided operation.java.util.Collection<AttributeModifier>modifiers(AttributeOperation operation)Gets a collection of applied modifiers with the provided operation.voidremoveModifier(java.util.UUID uniqueId)Removes a modifier from this attribute using it's unique id.voidremoveModifier(AttributeModifier modifier)Removes a modifier from this attribute.voidsetBaseValue(double baseValue)Sets the base value of this attribute.AttributeTypetype()Gets the type of this attribute.doublevalue()Gets the value of this attribute.
 
- 
- 
- 
Method Detail- 
typeAttributeType type() Gets the type of this attribute.- Returns:
- The attribute type.
 
 - 
baseValuedouble baseValue() Gets the base value of this attribute.This is the value of this attribute before any AttributeModifiers are applied.- Returns:
- The base value.
 
 - 
setBaseValuevoid setBaseValue(double baseValue) Sets the base value of this attribute.This is the value before modifiers are applied. - Parameters:
- baseValue- The base value
 
 - 
valuedouble value() Gets the value of this attribute.This is the value with modifiers applied. - Returns:
- The value
 
 - 
modifiersjava.util.Collection<AttributeModifier> modifiers() Gets a collection of all applied modifiers.- Returns:
- A collection of applied modifiers
 
 - 
modifiersdefault java.util.Collection<AttributeModifier> modifiers(java.util.function.Supplier<? extends AttributeOperation> operation) Gets a collection of applied modifiers with the provided operation.- Parameters:
- operation- The operation
- Returns:
- A collection of modifiers
 
 - 
modifiersjava.util.Collection<AttributeModifier> modifiers(AttributeOperation operation) Gets a collection of applied modifiers with the provided operation.- Parameters:
- operation- The operation
- Returns:
- A collection of modifiers
 
 - 
hasModifierboolean hasModifier(AttributeModifier modifier) Checks if this attribute has the provided modifier.- Parameters:
- modifier- The modifier
- Returns:
- trueif this attribute has the modifier,- falseotherwise
 
 - 
modifierjava.util.Optional<AttributeModifier> modifier(java.util.UUID uniqueId) Gets an attribute modifier by its unique id.- Parameters:
- uniqueId- The unique id
- Returns:
- The attribute modifier, if present, Optional.empty()otherwise
 
 - 
addModifiervoid addModifier(AttributeModifier modifier) Adds a modifier to this attribute.- Parameters:
- modifier- The modifier
 
 - 
removeModifiervoid removeModifier(AttributeModifier modifier) Removes a modifier from this attribute.- Parameters:
- modifier- The modifier
 
 - 
removeModifiervoid removeModifier(java.util.UUID uniqueId) Removes a modifier from this attribute using it's unique id.- Parameters:
- uniqueId- The unique id of the modifier.
 
 
- 
 
-