Record Class EntityEquipmentPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityEquipmentPredicate
public record EntityEquipmentPredicate(Optional<ItemPredicate> head, Optional<ItemPredicate> chest, Optional<ItemPredicate> legs, Optional<ItemPredicate> feet, Optional<ItemPredicate> mainhand, Optional<ItemPredicate> offhand)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EntityEquipmentPredicate
private final Optional<ItemPredicate>
The field for thechest
record component.static final com.mojang.serialization.Codec<EntityEquipmentPredicate>
private final Optional<ItemPredicate>
The field for thefeet
record component.private final Optional<ItemPredicate>
The field for thehead
record component.private final Optional<ItemPredicate>
The field for thelegs
record component.private final Optional<ItemPredicate>
The field for themainhand
record component.private final Optional<ItemPredicate>
The field for theoffhand
record component. -
Constructor Summary
ConstructorDescriptionEntityEquipmentPredicate
(Optional<ItemPredicate> head, Optional<ItemPredicate> chest, Optional<ItemPredicate> legs, Optional<ItemPredicate> feet, Optional<ItemPredicate> mainhand, Optional<ItemPredicate> offhand) Creates an instance of aEntityEquipmentPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionchest()
Returns the value of thechest
record component.final boolean
Indicates whether some other object is "equal to" this one.feet()
Returns the value of thefeet
record component.final int
hashCode()
Returns a hash code value for this object.head()
Returns the value of thehead
record component.legs()
Returns the value of thelegs
record component.mainhand()
Returns the value of themainhand
record component.boolean
offhand()
Returns the value of theoffhand
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
head
The field for thehead
record component. -
chest
The field for thechest
record component. -
legs
The field for thelegs
record component. -
feet
The field for thefeet
record component. -
mainhand
The field for themainhand
record component. -
offhand
The field for theoffhand
record component. -
CODEC
-
CAPTAIN
-
-
Constructor Details
-
EntityEquipmentPredicate
public EntityEquipmentPredicate(Optional<ItemPredicate> head, Optional<ItemPredicate> chest, Optional<ItemPredicate> legs, Optional<ItemPredicate> feet, Optional<ItemPredicate> mainhand, Optional<ItemPredicate> offhand) Creates an instance of aEntityEquipmentPredicate
record class.- Parameters:
head
- the value for thehead
record componentchest
- the value for thechest
record componentlegs
- the value for thelegs
record componentfeet
- the value for thefeet
record componentmainhand
- the value for themainhand
record componentoffhand
- the value for theoffhand
record component
-
-
Method Details
-
matches
-
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)
. -
head
Returns the value of thehead
record component.- Returns:
- the value of the
head
record component
-
chest
Returns the value of thechest
record component.- Returns:
- the value of the
chest
record component
-
legs
Returns the value of thelegs
record component.- Returns:
- the value of the
legs
record component
-
feet
Returns the value of thefeet
record component.- Returns:
- the value of the
feet
record component
-
mainhand
Returns the value of themainhand
record component.- Returns:
- the value of the
mainhand
record component
-
offhand
Returns the value of theoffhand
record component.- Returns:
- the value of the
offhand
record component
-