Package net.minecraft.entity.attribute
Class EntityAttributeInstance
java.lang.Object
net.minecraft.entity.attribute.EntityAttributeInstance
public class EntityAttributeInstance extends Object
A double-valued attribute.
- Mappings:
Namespace Name official ase
intermediary net/minecraft/class_1324
named net/minecraft/entity/attribute/EntityAttributeInstance
-
Field Summary
Fields Modifier and Type Field Description private double
baseValue
private boolean
dirty
private Map<UUID,EntityAttributeModifier>
idToModifiers
private Map<EntityAttributeModifier.Operation,Set<EntityAttributeModifier>>
operationToModifiers
private Set<EntityAttributeModifier>
persistentModifiers
private EntityAttribute
type
private Consumer<EntityAttributeInstance>
updateCallback
private double
value
-
Constructor Summary
Constructors Constructor Description EntityAttributeInstance(EntityAttribute type, Consumer<EntityAttributeInstance> updateCallback)
-
Method Summary
-
Field Details
-
type
- Mappings:
Namespace Name Mixin selector official a
Lase;a:Lasd;
intermediary field_23700
Lnet/minecraft/class_1324;field_23700:Lnet/minecraft/class_1320;
named type
Lnet/minecraft/entity/attribute/EntityAttributeInstance;type:Lnet/minecraft/entity/attribute/EntityAttribute;
-
operationToModifiers
private final Map<EntityAttributeModifier.Operation,Set<EntityAttributeModifier>> operationToModifiers- Mappings:
Namespace Name Mixin selector official b
Lase;b:Ljava/util/Map;
intermediary field_23701
Lnet/minecraft/class_1324;field_23701:Ljava/util/Map;
named operationToModifiers
Lnet/minecraft/entity/attribute/EntityAttributeInstance;operationToModifiers:Ljava/util/Map;
-
idToModifiers
- Mappings:
Namespace Name Mixin selector official c
Lase;c:Ljava/util/Map;
intermediary field_23702
Lnet/minecraft/class_1324;field_23702:Ljava/util/Map;
named idToModifiers
Lnet/minecraft/entity/attribute/EntityAttributeInstance;idToModifiers:Ljava/util/Map;
-
persistentModifiers
- Mappings:
Namespace Name Mixin selector official d
Lase;d:Ljava/util/Set;
intermediary field_23703
Lnet/minecraft/class_1324;field_23703:Ljava/util/Set;
named persistentModifiers
Lnet/minecraft/entity/attribute/EntityAttributeInstance;persistentModifiers:Ljava/util/Set;
-
baseValue
private double baseValue- Mappings:
Namespace Name Mixin selector official e
Lase;e:D
intermediary field_23704
Lnet/minecraft/class_1324;field_23704:D
named baseValue
Lnet/minecraft/entity/attribute/EntityAttributeInstance;baseValue:D
-
dirty
private boolean dirty- Mappings:
Namespace Name Mixin selector official f
Lase;f:Z
intermediary field_23705
Lnet/minecraft/class_1324;field_23705:Z
named dirty
Lnet/minecraft/entity/attribute/EntityAttributeInstance;dirty:Z
-
value
private double value- Mappings:
Namespace Name Mixin selector official g
Lase;g:D
intermediary field_23706
Lnet/minecraft/class_1324;field_23706:D
named value
Lnet/minecraft/entity/attribute/EntityAttributeInstance;value:D
-
updateCallback
- Mappings:
Namespace Name Mixin selector official h
Lase;h:Ljava/util/function/Consumer;
intermediary field_23707
Lnet/minecraft/class_1324;field_23707:Ljava/util/function/Consumer;
named updateCallback
Lnet/minecraft/entity/attribute/EntityAttributeInstance;updateCallback:Ljava/util/function/Consumer;
-
-
Constructor Details
-
EntityAttributeInstance
public EntityAttributeInstance(EntityAttribute type, Consumer<EntityAttributeInstance> updateCallback)- Mappings:
Namespace Name Mixin selector official <init>
Lase;<init>(Lasd;Ljava/util/function/Consumer;)V
intermediary <init>
Lnet/minecraft/class_1324;<init>(Lnet/minecraft/class_1320;Ljava/util/function/Consumer;)V
named <init>
Lnet/minecraft/entity/attribute/EntityAttributeInstance;<init>(Lnet/minecraft/entity/attribute/EntityAttribute;Ljava/util/function/Consumer;)V
-
-
Method Details
-
getAttribute
- Mappings:
Namespace Name Mixin selector official a
Lase;a()Lasd;
intermediary method_6198
Lnet/minecraft/class_1324;method_6198()Lnet/minecraft/class_1320;
named getAttribute
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getAttribute()Lnet/minecraft/entity/attribute/EntityAttribute;
-
getBaseValue
public double getBaseValue()Gets the base value of this attribute instance. This is the value before any attribute modifiers are applied.- Mappings:
Namespace Name Mixin selector official b
Lase;b()D
intermediary method_6201
Lnet/minecraft/class_1324;method_6201()D
named getBaseValue
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getBaseValue()D
-
setBaseValue
public void setBaseValue(double baseValue)- Mappings:
Namespace Name Mixin selector official a
Lase;a(D)V
intermediary method_6192
Lnet/minecraft/class_1324;method_6192(D)V
named setBaseValue
Lnet/minecraft/entity/attribute/EntityAttributeInstance;setBaseValue(D)V
-
getModifiers
- Mappings:
Namespace Name Mixin selector official a
Lase;a(Lasg$a;)Ljava/util/Set;
intermediary method_6193
Lnet/minecraft/class_1324;method_6193(Lnet/minecraft/class_1322$class_1323;)Ljava/util/Set;
named getModifiers
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getModifiers(Lnet/minecraft/entity/attribute/EntityAttributeModifier$Operation;)Ljava/util/Set;
-
getModifiers
- Mappings:
Namespace Name Mixin selector official c
Lase;c()Ljava/util/Set;
intermediary method_6195
Lnet/minecraft/class_1324;method_6195()Ljava/util/Set;
named getModifiers
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getModifiers()Ljava/util/Set;
-
getModifier
- Mappings:
Namespace Name Mixin selector official a
Lase;a(Ljava/util/UUID;)Lasg;
intermediary method_6199
Lnet/minecraft/class_1324;method_6199(Ljava/util/UUID;)Lnet/minecraft/class_1322;
named getModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getModifier(Ljava/util/UUID;)Lnet/minecraft/entity/attribute/EntityAttributeModifier;
-
hasModifier
- Mappings:
Namespace Name Mixin selector official a
Lase;a(Lasg;)Z
intermediary method_6196
Lnet/minecraft/class_1324;method_6196(Lnet/minecraft/class_1322;)Z
named hasModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;hasModifier(Lnet/minecraft/entity/attribute/EntityAttributeModifier;)Z
-
addModifier
- Mappings:
Namespace Name Mixin selector official e
Lase;e(Lasg;)V
intermediary method_6197
Lnet/minecraft/class_1324;method_6197(Lnet/minecraft/class_1322;)V
named addModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;addModifier(Lnet/minecraft/entity/attribute/EntityAttributeModifier;)V
-
addTemporaryModifier
Adds a temporary attribute modifier. The modifier will not be serialized.- Mappings:
Namespace Name Mixin selector official b
Lase;b(Lasg;)V
intermediary method_26835
Lnet/minecraft/class_1324;method_26835(Lnet/minecraft/class_1322;)V
named addTemporaryModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;addTemporaryModifier(Lnet/minecraft/entity/attribute/EntityAttributeModifier;)V
-
addPersistentModifier
- Mappings:
Namespace Name Mixin selector official c
Lase;c(Lasg;)V
intermediary method_26837
Lnet/minecraft/class_1324;method_26837(Lnet/minecraft/class_1322;)V
named addPersistentModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;addPersistentModifier(Lnet/minecraft/entity/attribute/EntityAttributeModifier;)V
-
onUpdate
protected void onUpdate()- Mappings:
Namespace Name Mixin selector official d
Lase;d()V
intermediary method_26838
Lnet/minecraft/class_1324;method_26838()V
named onUpdate
Lnet/minecraft/entity/attribute/EntityAttributeInstance;onUpdate()V
-
removeModifier
- Mappings:
Namespace Name Mixin selector official d
Lase;d(Lasg;)V
intermediary method_6202
Lnet/minecraft/class_1324;method_6202(Lnet/minecraft/class_1322;)V
named removeModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;removeModifier(Lnet/minecraft/entity/attribute/EntityAttributeModifier;)V
-
removeModifier
- Mappings:
Namespace Name Mixin selector official b
Lase;b(Ljava/util/UUID;)V
intermediary method_6200
Lnet/minecraft/class_1324;method_6200(Ljava/util/UUID;)V
named removeModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;removeModifier(Ljava/util/UUID;)V
-
tryRemoveModifier
- Mappings:
Namespace Name Mixin selector official c
Lase;c(Ljava/util/UUID;)Z
intermediary method_27304
Lnet/minecraft/class_1324;method_27304(Ljava/util/UUID;)Z
named tryRemoveModifier
Lnet/minecraft/entity/attribute/EntityAttributeInstance;tryRemoveModifier(Ljava/util/UUID;)Z
-
clearModifiers
- Mappings:
Namespace Name Mixin selector official e
Lase;e()V
intermediary method_6203
Lnet/minecraft/class_1324;method_6203()V
named clearModifiers
Lnet/minecraft/entity/attribute/EntityAttributeInstance;clearModifiers()V
-
getValue
public double getValue()- Mappings:
Namespace Name Mixin selector official f
Lase;f()D
intermediary method_6194
Lnet/minecraft/class_1324;method_6194()D
named getValue
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getValue()D
-
computeValue
private double computeValue()Computes this attribute's value, taking modifiers into account.Attribute modifiers are applied in order by operation:
ADDITION
// Adds the value of the modifier to the attribute's base value.MULTIPLY_BASE
// Multiplies the value of the modifier to the attributes base value, and then adds it to the total value.MULTIPLY_TOTAL
// Adds 1 to the value of the attribute modifier. Then multiplies the attribute's value by the total value of the attribute after addition and multiplication of the base value occur.
- Mappings:
Namespace Name Mixin selector official h
Lase;h()D
intermediary method_26840
Lnet/minecraft/class_1324;method_26840()D
named computeValue
Lnet/minecraft/entity/attribute/EntityAttributeInstance;computeValue()D
-
getModifiersByOperation
private Collection<EntityAttributeModifier> getModifiersByOperation(EntityAttributeModifier.Operation operation)- Mappings:
Namespace Name Mixin selector official b
Lase;b(Lasg$a;)Ljava/util/Collection;
intermediary method_26834
Lnet/minecraft/class_1324;method_26834(Lnet/minecraft/class_1322$class_1323;)Ljava/util/Collection;
named getModifiersByOperation
Lnet/minecraft/entity/attribute/EntityAttributeInstance;getModifiersByOperation(Lnet/minecraft/entity/attribute/EntityAttributeModifier$Operation;)Ljava/util/Collection;
-
setFrom
Copies the values of an attribute to this attribute.Temporary modifiers are copied when using the operation.
- Mappings:
Namespace Name Mixin selector official a
Lase;a(Lase;)V
intermediary method_26831
Lnet/minecraft/class_1324;method_26831(Lnet/minecraft/class_1324;)V
named setFrom
Lnet/minecraft/entity/attribute/EntityAttributeInstance;setFrom(Lnet/minecraft/entity/attribute/EntityAttributeInstance;)V
-
toTag
- Mappings:
Namespace Name Mixin selector official g
Lase;g()Lmq;
intermediary method_26839
Lnet/minecraft/class_1324;method_26839()Lnet/minecraft/class_2487;
named toTag
Lnet/minecraft/entity/attribute/EntityAttributeInstance;toTag()Lnet/minecraft/nbt/CompoundTag;
-
fromTag
- Mappings:
Namespace Name Mixin selector official a
Lase;a(Lmq;)V
intermediary method_26833
Lnet/minecraft/class_1324;method_26833(Lnet/minecraft/class_2487;)V
named fromTag
Lnet/minecraft/entity/attribute/EntityAttributeInstance;fromTag(Lnet/minecraft/nbt/CompoundTag;)V
-