Package net.minecraft.entity.attribute
Record Class EntityAttributeModifier
java.lang.Object
java.lang.Record
net.minecraft.entity.attribute.EntityAttributeModifier
- Record Components:
uuid-name-value-operation-
public record EntityAttributeModifier(UUID uuid, String name, double value, EntityAttributeModifier.Operation operation)
extends Record
- Mappings:
Namespace Name official bryintermediary net/minecraft/class_1322named net/minecraft/entity/attribute/EntityAttributeModifierofficial dintermediary comp_2447named uuidofficial eintermediary comp_2448named nameofficial fintermediary comp_2449named valueofficial gintermediary comp_2450named operation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents an operation which can be applied to an attribute modifier. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EntityAttributeModifier> static final com.mojang.serialization.MapCodec<EntityAttributeModifier> static final PacketCodec<ByteBuf, EntityAttributeModifier> private static final Loggerprivate final StringThe field for thenamerecord component.private final EntityAttributeModifier.OperationThe field for theoperationrecord component.private final UUIDThe field for theuuidrecord component.private final doubleThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntityAttributeModifier(String name, double value, EntityAttributeModifier.Operation operation) EntityAttributeModifier(UUID uuid, String name, double value, EntityAttributeModifier.Operation operation) Creates an instance of aEntityAttributeModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @Nullable EntityAttributeModifierfromNbt(NbtCompound nbt) final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theoperationrecord component.toNbt()final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.doublevalue()Returns the value of thevaluerecord component.
-
Field Details
-
uuid
The field for theuuidrecord component. -
name
The field for thenamerecord component. -
value
private final double valueThe field for thevaluerecord component. -
operation
The field for theoperationrecord component. -
LOGGER
- Mappings:
Namespace Name Mixin selector official hLbry;h:Lorg/slf4j/Logger;intermediary field_23712Lnet/minecraft/class_1322;field_23712:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/entity/attribute/EntityAttributeModifier;LOGGER:Lorg/slf4j/Logger;
-
field_49232
- Mappings:
Namespace Name Mixin selector official aLbry;a:Lcom/mojang/serialization/MapCodec;intermediary field_49232Lnet/minecraft/class_1322;field_49232:Lcom/mojang/serialization/MapCodec;named field_49232Lnet/minecraft/entity/attribute/EntityAttributeModifier;field_49232:Lcom/mojang/serialization/MapCodec;
-
CODEC
- Mappings:
Namespace Name Mixin selector official bLbry;b:Lcom/mojang/serialization/Codec;intermediary field_46247Lnet/minecraft/class_1322;field_46247:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/entity/attribute/EntityAttributeModifier;CODEC:Lcom/mojang/serialization/Codec;
-
field_49233
- Mappings:
Namespace Name Mixin selector official cLbry;c:Lyg;intermediary field_49233Lnet/minecraft/class_1322;field_49233:Lnet/minecraft/class_9139;named field_49233Lnet/minecraft/entity/attribute/EntityAttributeModifier;field_49233:Lnet/minecraft/network/codec/PacketCodec;
-
-
Constructor Details
-
EntityAttributeModifier
public EntityAttributeModifier(String name, double value, EntityAttributeModifier.Operation operation) - Mappings:
Namespace Name Mixin selector official <init>Lbry;<init>(Ljava/lang/String;DLbry$a;)Vintermediary <init>Lnet/minecraft/class_1322;<init>(Ljava/lang/String;DLnet/minecraft/class_1322$class_1323;)Vnamed <init>Lnet/minecraft/entity/attribute/EntityAttributeModifier;<init>(Ljava/lang/String;DLnet/minecraft/entity/attribute/EntityAttributeModifier$Operation;)V
-
EntityAttributeModifier
public EntityAttributeModifier(UUID uuid, String name, double value, EntityAttributeModifier.Operation operation) Creates an instance of aEntityAttributeModifierrecord class.
-
-
Method Details
-
toNbt
- Mappings:
Namespace Name Mixin selector official aLbry;a()Lto;intermediary method_26860Lnet/minecraft/class_1322;method_26860()Lnet/minecraft/class_2487;named toNbtLnet/minecraft/entity/attribute/EntityAttributeModifier;toNbt()Lnet/minecraft/nbt/NbtCompound;
-
fromNbt
- Mappings:
Namespace Name Mixin selector official aLbry;a(Lto;)Lbry;intermediary method_26859Lnet/minecraft/class_1322;method_26859(Lnet/minecraft/class_2487;)Lnet/minecraft/class_1322;named fromNbtLnet/minecraft/entity/attribute/EntityAttributeModifier;fromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/entity/attribute/EntityAttributeModifier;
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
value
public double value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-