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 double
private final String
protected static final TextColor
protected static final TextColor
protected static final TextColor
private Attribute.Sentiment
static final StreamCodec
<RegistryFriendlyByteBuf, Holder<Attribute>> private boolean
Fields inherited from interface net.neoforged.neoforge.common.extensions.IAttributeExtension
FORMAT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getMergedStyle
(boolean isPositive) Returns the color used by merged attribute modifiers.getStyle
(boolean p_347715_) boolean
double
sanitizeValue
(double p_22083_) setSentiment
(Attribute.Sentiment p_347714_) setSyncable
(boolean p_22085_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.common.extensions.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 p_22083_) -
getDescriptionId
-
getStyle
-
getMergedStyle
Description copied from interface:IAttributeExtension
Returns 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:
getMergedStyle
in interfaceIAttributeExtension
-