Record Class SetAttributesFunction.Modifier
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.SetAttributesFunction.Modifier
- Enclosing class:
- SetAttributesFunction
static record SetAttributesFunction.Modifier(String name, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlot> slots, Optional<UUID> id)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NumberProviderThe field for theamountrecord component.The field for theattributerecord component.static final com.mojang.serialization.Codec<SetAttributesFunction.Modifier>The field for theidrecord component.private final StringThe field for thenamerecord component.private final AttributeModifier.OperationThe field for theoperationrecord component.private final List<EquipmentSlot>The field for theslotsrecord component.private static final com.mojang.serialization.Codec<List<EquipmentSlot>> -
Constructor Summary
ConstructorsConstructorDescriptionModifier(String name, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlot> slots, Optional<UUID> id) Creates an instance of aModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.Returns the value of theattributerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.Returns the value of theoperationrecord component.slots()Returns the value of theslotsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
name
The field for thenamerecord component. -
attribute
The field for theattributerecord component. -
operation
The field for theoperationrecord component. -
amount
The field for theamountrecord component. -
slots
The field for theslotsrecord component. -
id
The field for theidrecord component. -
SLOTS_CODEC
-
CODEC
-
-
Constructor Details
-
Modifier
Modifier(String name, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlot> slots, Optional<UUID> id) Creates an instance of aModifierrecord class.- Parameters:
name- the value for thenamerecord componentattribute- the value for theattributerecord componentoperation- the value for theoperationrecord componentamount- the value for theamountrecord componentslots- the value for theslotsrecord componentid- the value for theidrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
attribute
Returns the value of theattributerecord component.- Returns:
- the value of the
attributerecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
slots
Returns the value of theslotsrecord component.- Returns:
- the value of the
slotsrecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-