Record Class EntityVariantPredicate.SubPredicate<V>
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityVariantPredicate.SubPredicate<V>
- All Implemented Interfaces:
- EntitySubPredicate
- Enclosing class:
- EntityVariantPredicate<V>
public static record EntityVariantPredicate.SubPredicate<V>(EntitySubPredicate.Type type, Function<Entity,Optional<V>> getter, V variant)
extends Record
implements EntitySubPredicate 
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.minecraft.advancements.critereon.EntitySubPredicateEntitySubPredicate.Type, EntitySubPredicate.Types
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe field for thegetterrecord component.private final EntitySubPredicate.TypeThe field for thetyperecord component.private final VThe field for thevariantrecord component.Fields inherited from interface net.minecraft.advancements.critereon.EntitySubPredicateCODEC
- 
Constructor SummaryConstructorsConstructorDescriptionSubPredicate(EntitySubPredicate.Type type, Function<Entity, Optional<V>> getter, V variant) Creates an instance of aSubPredicaterecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getter()Returns the value of thegetterrecord component.final inthashCode()Returns a hash code value for this object.booleanmatches(Entity p_299274_, ServerLevel p_298330_, Vec3 p_298762_) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.variant()Returns the value of thevariantrecord component.
- 
Field Details- 
typeThe field for thetyperecord component.
- 
getterThe field for thegetterrecord component.
- 
variantThe field for thevariantrecord component.
 
- 
- 
Constructor Details- 
SubPredicateCreates an instance of aSubPredicaterecord class.- Parameters:
- type- the value for the- typerecord component
- getter- the value for the- getterrecord component
- variant- the value for the- variantrecord component
 
 
- 
- 
Method Details- 
matches- Specified by:
- matchesin interface- EntitySubPredicate
 
- 
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).
- 
typeReturns the value of thetyperecord component.- Specified by:
- typein interface- EntitySubPredicate
- Returns:
- the value of the typerecord component
 
- 
getterReturns the value of thegetterrecord component.- Returns:
- the value of the getterrecord component
 
- 
variantReturns the value of thevariantrecord component.- Returns:
- the value of the variantrecord component
 
 
-