Record Class EntityTagPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.predicates.entity.EntityTagPredicate
- All Implemented Interfaces:
EntitySubPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theallOfrecord component.The field for theanyOfrecord component.static final com.mojang.serialization.Codec<EntityTagPredicate> The field for thenoneOfrecord component.Fields inherited from interface EntitySubPredicate
ALWAYS_TRUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallOf()Returns the value of theallOfrecord component.anyOf()Returns the value of theanyOfrecord component.private static booleancontainsAllOf(Set<String> provided, List<String> tags) private static booleancontainsAtLeastOne(Set<String> provided, List<String> tags) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleanmatches(Entity entity, ServerLevel level, @Nullable Vec3 position) noneOf()Returns the value of thenoneOfrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface EntitySubPredicate
and
-
Field Details
-
anyOf
-
allOf
-
noneOf
-
CODEC
-
-
Constructor Details
-
EntityTagPredicate
public EntityTagPredicate(Optional<List<String>> anyOf, Optional<List<String>> allOf, Optional<List<String>> noneOf) Creates an instance of aEntityTagPredicaterecord class.- Parameters:
anyOf- the value for theanyOfrecord componentallOf- the value for theallOfrecord componentnoneOf- the value for thenoneOfrecord component
-
-
Method Details
-
matches
-
matches
- Specified by:
matchesin interfaceEntitySubPredicate
-
containsAtLeastOne
-
containsAllOf
-
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). -
anyOf
-
allOf
-
noneOf
-