Record Class EntityTypePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.predicates.entity.EntityTypePredicate
- All Implemented Interfaces:
EntitySubPredicate
public record EntityTypePredicate(HolderSet<EntityType<?>> types)
extends Record
implements EntitySubPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EntityTypePredicate> private final HolderSet<EntityType<?>> The field for thetypesrecord component.Fields inherited from interface EntitySubPredicate
ALWAYS_TRUE -
Constructor Summary
ConstructorsConstructorDescriptionEntityTypePredicate(HolderSet<EntityType<?>> types) Creates an instance of aEntityTypePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(Holder<EntityType<?>> type) booleanmatches(Entity entity, ServerLevel level, @Nullable Vec3 position) static EntityTypePredicateof(HolderGetter<EntityType<?>> lookup, TagKey<EntityType<?>> type) static EntityTypePredicateof(HolderGetter<EntityType<?>> lookup, EntityType<?> type) final StringtoString()Returns a string representation of this record class.HolderSet<EntityType<?>> types()Returns the value of thetypesrecord component.Methods inherited from interface EntitySubPredicate
and
-
Field Details
-
types
The field for thetypesrecord component. -
CODEC
-
-
Constructor Details
-
EntityTypePredicate
Creates an instance of aEntityTypePredicaterecord class.- Parameters:
types- the value for thetypesrecord component
-
-
Method Details
-
of
-
of
public static EntityTypePredicate of(HolderGetter<EntityType<?>> lookup, TagKey<EntityType<?>> type) -
matches
-
matches
- Specified by:
matchesin interfaceEntitySubPredicate
-
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). -
types
Returns the value of thetypesrecord component.- Returns:
- the value of the
typesrecord component
-