Record Class SetAttributesFunction.Modifier
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.functions.SetAttributesFunction.Modifier
- All Implemented Interfaces:
LootContextUser, Validatable
- Enclosing class:
SetAttributesFunction
private static record SetAttributesFunction.Modifier(Identifier id, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlotGroup> slots)
extends Record
implements LootContextUser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NumberProviderThe field for theamountrecord component.The field for theattributerecord component.static final com.mojang.serialization.Codec<SetAttributesFunction.Modifier> private final IdentifierThe field for theidrecord component.private final AttributeModifier.OperationThe field for theoperationrecord component.private final List<EquipmentSlotGroup> The field for theslotsrecord component.private static final com.mojang.serialization.Codec<List<EquipmentSlotGroup>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateModifier(Identifier id, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlotGroup> slots) 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.Returns the value of theoperationrecord component.slots()Returns the value of theslotsrecord component.final StringtoString()Returns a string representation of this record class.voidvalidate(ValidationContext context) Validate that this object is used correctly according to the given ValidationContext.Methods inherited from interface LootContextUser
getReferencedContextParams
-
Field Details
-
id
The field for theidrecord component. -
attribute
-
operation
The field for theoperationrecord component. -
amount
The field for theamountrecord component. -
slots
The field for theslotsrecord component. -
SLOTS_CODEC
-
CODEC
-
-
Constructor Details
-
Modifier
private Modifier(Identifier id, Holder<Attribute> attribute, AttributeModifier.Operation operation, NumberProvider amount, List<EquipmentSlotGroup> slots) Creates an instance of aModifierrecord class.- Parameters:
id- the value for theidrecord componentattribute- the value for theattributerecord componentoperation- the value for theoperationrecord componentamount- the value for theamountrecord componentslots- the value for theslotsrecord component
-
-
Method Details
-
validate
Description copied from interface:LootContextUserValidate that this object is used correctly according to the given ValidationContext.- Specified by:
validatein interfaceLootContextUser- Specified by:
validatein interfaceValidatable
-
toString
-
hashCode
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
attribute
-
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
-