Class AttributeInstance
java.lang.Object
net.minecraft.world.entity.ai.attributes.AttributeInstance
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private double
private double
private boolean
static final String
private final Map
<ResourceLocation, AttributeModifier> private static final String
private final Map
<AttributeModifier.Operation, Map<ResourceLocation, AttributeModifier>> private final Consumer
<AttributeInstance> private final Map
<ResourceLocation, AttributeModifier> -
Constructor Summary
ConstructorDescriptionAttributeInstance
(Holder<Attribute> p_335359_, Consumer<AttributeInstance> p_22098_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addModifier
(AttributeModifier p_22134_) void
addOrReplacePermanentModifier
(AttributeModifier p_343885_) void
addOrUpdateTransientModifier
(AttributeModifier p_327789_) void
addPermanentModifier
(AttributeModifier p_22126_) void
addTransientModifier
(AttributeModifier p_22119_) private double
double
getModifier
(ResourceLocation p_344264_) (package private) Map
<ResourceLocation, AttributeModifier> getModifiers
(AttributeModifier.Operation p_22105_) private Collection
<AttributeModifier> double
getValue()
boolean
hasModifier
(ResourceLocation p_344370_) void
load
(CompoundTag p_22114_) boolean
removeModifier
(ResourceLocation p_344753_) void
removeModifier
(AttributeModifier p_22131_) void
void
replaceFrom
(AttributeInstance p_22103_) save()
void
setBaseValue
(double p_22101_) protected void
setDirty()
-
Field Details
-
BASE_FIELD
- See Also:
-
MODIFIERS_FIELD
- See Also:
-
ID_FIELD
- See Also:
-
attribute
-
modifiersByOperation
private final Map<AttributeModifier.Operation,Map<ResourceLocation, modifiersByOperationAttributeModifier>> -
modifierById
-
permanentModifiers
-
baseValue
private double baseValue -
dirty
private boolean dirty -
cachedValue
private double cachedValue -
onDirty
-
-
Constructor Details
-
AttributeInstance
-
-
Method Details
-
getAttribute
-
getBaseValue
public double getBaseValue() -
setBaseValue
public void setBaseValue(double p_22101_) -
getModifiers
-
getModifiers
-
getModifier
-
hasModifier
-
addModifier
-
addOrUpdateTransientModifier
-
addTransientModifier
-
addOrReplacePermanentModifier
-
addPermanentModifier
-
setDirty
protected void setDirty() -
removeModifier
-
removeModifier
-
removeModifiers
public void removeModifiers() -
getValue
public double getValue() -
calculateValue
private double calculateValue() -
getModifiersOrEmpty
-
replaceFrom
-
save
-
load
-