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> body, Optional<ItemPredicate> mainhand, Optional<ItemPredicate> offhand)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<ItemPredicate> The field for thebodyrecord component.private final Optional<ItemPredicate> The field for thechestrecord component.static final com.mojang.serialization.Codec<EntityEquipmentPredicate> private final Optional<ItemPredicate> The field for thefeetrecord component.private final Optional<ItemPredicate> The field for theheadrecord component.private final Optional<ItemPredicate> The field for thelegsrecord component.private final Optional<ItemPredicate> The field for themainhandrecord component.private final Optional<ItemPredicate> The field for theoffhandrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntityEquipmentPredicate(Optional<ItemPredicate> head, Optional<ItemPredicate> chest, Optional<ItemPredicate> legs, Optional<ItemPredicate> feet, Optional<ItemPredicate> body, Optional<ItemPredicate> mainhand, Optional<ItemPredicate> offhand) Creates an instance of aEntityEquipmentPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionbody()Returns the value of thebodyrecord component.static EntityEquipmentPredicatecaptainPredicate(HolderGetter<BannerPattern> p_332749_) chest()Returns the value of thechestrecord component.final booleanIndicates whether some other object is "equal to" this one.feet()Returns the value of thefeetrecord component.final inthashCode()Returns a hash code value for this object.head()Returns the value of theheadrecord component.legs()Returns the value of thelegsrecord component.mainhand()Returns the value of themainhandrecord component.booleanoffhand()Returns the value of theoffhandrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
head
The field for theheadrecord component. -
chest
The field for thechestrecord component. -
legs
The field for thelegsrecord component. -
feet
The field for thefeetrecord component. -
body
The field for thebodyrecord component. -
mainhand
The field for themainhandrecord component. -
offhand
The field for theoffhandrecord component. -
CODEC
-
-
Constructor Details
-
EntityEquipmentPredicate
public EntityEquipmentPredicate(Optional<ItemPredicate> head, Optional<ItemPredicate> chest, Optional<ItemPredicate> legs, Optional<ItemPredicate> feet, Optional<ItemPredicate> body, Optional<ItemPredicate> mainhand, Optional<ItemPredicate> offhand) Creates an instance of aEntityEquipmentPredicaterecord class.- Parameters:
head- the value for theheadrecord componentchest- the value for thechestrecord componentlegs- the value for thelegsrecord componentfeet- the value for thefeetrecord componentbody- the value for thebodyrecord componentmainhand- the value for themainhandrecord componentoffhand- the value for theoffhandrecord component
-
-
Method Details
-
captainPredicate
-
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 theheadrecord component.- Returns:
- the value of the
headrecord component
-
chest
Returns the value of thechestrecord component.- Returns:
- the value of the
chestrecord component
-
legs
Returns the value of thelegsrecord component.- Returns:
- the value of the
legsrecord component
-
feet
Returns the value of thefeetrecord component.- Returns:
- the value of the
feetrecord component
-
body
Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
mainhand
Returns the value of themainhandrecord component.- Returns:
- the value of the
mainhandrecord component
-
offhand
Returns the value of theoffhandrecord component.- Returns:
- the value of the
offhandrecord component
-