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
Modifier and TypeFieldDescriptionprivate final NumberProvider
The field for theamount
record component.The field for theattribute
record component.static final com.mojang.serialization.Codec<SetAttributesFunction.Modifier>
The field for theid
record component.private final String
The field for thename
record component.private final AttributeModifier.Operation
The field for theoperation
record component.private final List<EquipmentSlot>
The field for theslots
record component.private static final com.mojang.serialization.Codec<List<EquipmentSlot>>
-
Constructor Summary
ConstructorDescriptionModifier
(String name, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlot> slots, Optional<UUID> id) Creates an instance of aModifier
record class. -
Method Summary
Modifier and TypeMethodDescriptionamount()
Returns the value of theamount
record component.Returns the value of theattribute
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.name()
Returns the value of thename
record component.Returns the value of theoperation
record component.slots()
Returns the value of theslots
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
name
The field for thename
record component. -
attribute
The field for theattribute
record component. -
operation
The field for theoperation
record component. -
amount
The field for theamount
record component. -
slots
The field for theslots
record component. -
id
The field for theid
record 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 aModifier
record class.- Parameters:
name
- the value for thename
record componentattribute
- the value for theattribute
record componentoperation
- the value for theoperation
record componentamount
- the value for theamount
record componentslots
- the value for theslots
record componentid
- the value for theid
record 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 thename
record component.- Returns:
- the value of the
name
record component
-
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-
operation
Returns the value of theoperation
record component.- Returns:
- the value of the
operation
record component
-
amount
Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
slots
Returns the value of theslots
record component.- Returns:
- the value of the
slots
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-