Class AttributeInstance
java.lang.Object
net.minecraft.world.entity.ai.attributes.AttributeInstance
-
Field Summary
Modifier and TypeFieldDescriptionprivate double
private double
private boolean
private final Map
<UUID, AttributeModifier> private final Map
<AttributeModifier.Operation, Map<UUID, AttributeModifier>> private final Consumer
<AttributeInstance> private final Map
<UUID, AttributeModifier> -
Constructor Summary
ConstructorDescriptionAttributeInstance
(Holder<Attribute> p_316357_, Consumer<AttributeInstance> p_22098_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addModifier
(AttributeModifier p_22134_) void
addOrUpdateTransientModifier
(AttributeModifier p_316482_) void
addPermanentModifier
(AttributeModifier p_22126_) void
addTransientModifier
(AttributeModifier p_22119_) private double
double
getModifier
(UUID p_22112_) (package private) Map
<UUID, AttributeModifier> getModifiers
(AttributeModifier.Operation p_22105_) private Collection
<AttributeModifier> double
getValue()
boolean
hasModifier
(AttributeModifier p_22110_) void
load
(CompoundTag p_22114_) void
removeModifier
(UUID p_22121_) void
removeModifier
(AttributeModifier p_22131_) void
boolean
removePermanentModifier
(UUID p_22128_) void
replaceFrom
(AttributeInstance p_22103_) save()
void
setBaseValue
(double p_22101_) protected void
setDirty()
-
Field Details
-
attribute
-
modifiersByOperation
-
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
-
addPermanentModifier
-
setDirty
protected void setDirty() -
removeModifier
-
removeModifier
-
removePermanentModifier
-
removeModifiers
public void removeModifiers() -
getValue
public double getValue() -
calculateValue
private double calculateValue() -
getModifiersOrEmpty
-
replaceFrom
-
save
-
load
-