Class Attribute
java.lang.Object
net.minecraft.world.entity.ai.attributes.Attribute
- All Implemented Interfaces:
IAttributeExtension
- Direct Known Subclasses:
BooleanAttribute, RangedAttribute
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate final Stringprotected static final TextColorprotected static final TextColorprotected static final TextColorprivate Attribute.Sentimentstatic final StreamCodec<RegistryFriendlyByteBuf, Holder<Attribute>> private booleanFields inherited from interface IAttributeExtension
FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetMergedStyle(boolean isPositive) Returns the color used by merged attribute modifiers.getStyle(boolean valueIncrease) booleandoublesanitizeValue(double value) setSentiment(Attribute.Sentiment sentiment) setSyncable(boolean syncable) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAttributeExtension
getBaseId, getDebugInfo, toBaseComponent, toComponent, toValueComponent
-
Field Details
-
CODEC
-
STREAM_CODEC
-
defaultValue
private final double defaultValue -
syncable
private boolean syncable -
descriptionId
-
sentiment
-
MERGED_RED
-
MERGED_BLUE
-
MERGED_GRAY
-
-
Constructor Details
-
Attribute
-
-
Method Details
-
getDefaultValue
public double getDefaultValue() -
isClientSyncable
public boolean isClientSyncable() -
setSyncable
-
setSentiment
-
sanitizeValue
public double sanitizeValue(double value) -
getDescriptionId
-
getStyle
-
getMergedStyle
Description copied from interface:IAttributeExtensionReturns the color used by merged attribute modifiers. Only used whenNeoForgeMod.enableMergedAttributeTooltips()is active.Similarly to
getStyle(boolean), this method should return a color based on the attribute'sAttribute.Sentiment. The returned color should be distinguishable from the color used bygetStyle(boolean).- Specified by:
getMergedStylein interfaceIAttributeExtension
-