Class ModifiableAttributeInstance
java.lang.Object
net.minecraft.entity.ai.attributes.ModifiableAttributeInstance
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Attribute
private double
private double
private boolean
private final Map<UUID,
AttributeModifier> private final Map<AttributeModifier.Operation,
Set<AttributeModifier>> private final Consumer<ModifiableAttributeInstance>
private final Set<AttributeModifier>
-
Constructor Summary
ConstructorDescriptionModifiableAttributeInstance
(Attribute p_i231501_1_, Consumer<ModifiableAttributeInstance> p_i231501_2_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addModifier
(AttributeModifier p_111121_1_) void
addPermanentModifier
(AttributeModifier p_233769_1_) void
addTransientModifier
(AttributeModifier p_233767_1_) private double
double
getModifier
(UUID p_111127_1_) getModifiers
(AttributeModifier.Operation p_225504_1_) private Collection<AttributeModifier>
getModifiersOrEmpty
(AttributeModifier.Operation p_220370_1_) double
getValue()
boolean
hasModifier
(AttributeModifier p_180374_1_) void
load
(CompoundNBT p_233765_1_) void
removeModifier
(UUID p_188479_1_) void
removeModifier
(AttributeModifier p_111124_1_) void
boolean
removePermanentModifier
(UUID p_233770_1_) void
replaceFrom
(ModifiableAttributeInstance p_233763_1_) save()
void
setBaseValue
(double p_111128_1_) protected void
setDirty()
-
Field Details
-
attribute
-
modifiersByOperation
-
modifierById
-
permanentModifiers
-
baseValue
private double baseValue -
dirty
private boolean dirty -
cachedValue
private double cachedValue -
onDirty
-
-
Constructor Details
-
ModifiableAttributeInstance
public ModifiableAttributeInstance(Attribute p_i231501_1_, Consumer<ModifiableAttributeInstance> p_i231501_2_)
-
-
Method Details
-
getAttribute
-
getBaseValue
public double getBaseValue() -
setBaseValue
public void setBaseValue(double p_111128_1_) -
getModifiers
-
getModifiers
-
getModifier
-
hasModifier
-
addModifier
-
addTransientModifier
-
addPermanentModifier
-
setDirty
protected void setDirty() -
removeModifier
-
removeModifier
-
removePermanentModifier
-
removeModifiers
public void removeModifiers() -
getValue
public double getValue() -
calculateValue
private double calculateValue() -
getModifiersOrEmpty
-
replaceFrom
-
save
-
load
-