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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionModifier(String name, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlot> slots, Optional<UUID> id) Creates an instance of aModifierrecord class.
- 
Method SummaryModifier 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- 
nameThe field for thenamerecord component.
- 
attributeThe field for theattributerecord component.
- 
operationThe field for theoperationrecord component.
- 
amountThe field for theamountrecord component.
- 
slotsThe field for theslotsrecord component.
- 
idThe field for theidrecord component.
- 
SLOTS_CODEC
- 
CODEC
 
- 
- 
Constructor Details- 
ModifierModifier(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 the- namerecord component
- attribute- the value for the- attributerecord component
- operation- the value for the- operationrecord component
- amount- the value for the- amountrecord component
- slots- the value for the- slotsrecord component
- id- the value for the- idrecord component
 
 
- 
- 
Method Details- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
nameReturns the value of thenamerecord component.- Returns:
- the value of the namerecord component
 
- 
attributeReturns the value of theattributerecord component.- Returns:
- the value of the attributerecord component
 
- 
operationReturns the value of theoperationrecord component.- Returns:
- the value of the operationrecord component
 
- 
amountReturns the value of theamountrecord component.- Returns:
- the value of the amountrecord component
 
- 
slotsReturns the value of theslotsrecord component.- Returns:
- the value of the slotsrecord component
 
- 
idReturns the value of theidrecord component.- Returns:
- the value of the idrecord component
 
 
-