Record Class ItemAttributeModifiersPredicate.EntryPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemAttributeModifiersPredicate.EntryPredicate
- All Implemented Interfaces:
Predicate<ItemAttributeModifiers.Entry>
- Enclosing class:
ItemAttributeModifiersPredicate
public static record ItemAttributeModifiersPredicate.EntryPredicate(Optional<HolderSet<Attribute>> attribute, Optional<UUID> id, Optional<String> name, MinMaxBounds.Doubles amount, Optional<AttributeModifier.Operation> operation, Optional<EquipmentSlotGroup> slot)
extends Record
implements Predicate<ItemAttributeModifiers.Entry>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final MinMaxBounds.Doubles
The field for theamount
record component.The field for theattribute
record component.static final com.mojang.serialization.Codec
<ItemAttributeModifiersPredicate.EntryPredicate> The field for theid
record component.The field for thename
record component.private final Optional
<AttributeModifier.Operation> The field for theoperation
record component.private final Optional
<EquipmentSlotGroup> The field for theslot
record component. -
Constructor Summary
ConstructorDescriptionEntryPredicate
(Optional<HolderSet<Attribute>> attribute, Optional<UUID> id, Optional<String> name, MinMaxBounds.Doubles amount, Optional<AttributeModifier.Operation> operation, Optional<EquipmentSlotGroup> slot) Creates an instance of aEntryPredicate
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.slot()
Returns the value of theslot
record component.boolean
test
(ItemAttributeModifiers.Entry p_341096_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
attribute
The field for theattribute
record component. -
id
The field for theid
record component. -
name
The field for thename
record component. -
amount
The field for theamount
record component. -
operation
The field for theoperation
record component. -
slot
The field for theslot
record component. -
CODEC
public static final com.mojang.serialization.Codec<ItemAttributeModifiersPredicate.EntryPredicate> CODEC
-
-
Constructor Details
-
EntryPredicate
public EntryPredicate(Optional<HolderSet<Attribute>> attribute, Optional<UUID> id, Optional<String> name, MinMaxBounds.Doubles amount, Optional<AttributeModifier.Operation> operation, Optional<EquipmentSlotGroup> slot) Creates an instance of aEntryPredicate
record class.- Parameters:
attribute
- the value for theattribute
record componentid
- the value for theid
record componentname
- the value for thename
record componentamount
- the value for theamount
record componentoperation
- the value for theoperation
record componentslot
- the value for theslot
record component
-
-
Method Details
-
test
- Specified by:
test
in interfacePredicate<ItemAttributeModifiers.Entry>
-
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)
. -
attribute
Returns the value of theattribute
record component.- Returns:
- the value of the
attribute
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
amount
Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
operation
Returns the value of theoperation
record component.- Returns:
- the value of the
operation
record component
-
slot
Returns the value of theslot
record component.- Returns:
- the value of the
slot
record component
-