Record Class EntityTypePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityTypePredicate
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EntityTypePredicate>
private final HolderSet<EntityType<?>>
The field for thetypes
record component. -
Constructor Summary
ConstructorDescriptionEntityTypePredicate
(HolderSet<EntityType<?>> types) Creates an instance of aEntityTypePredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(EntityType<?> p_37642_) static EntityTypePredicate
of
(TagKey<EntityType<?>> p_204082_) static EntityTypePredicate
of
(EntityType<?> p_37648_) final String
toString()
Returns a string representation of this record class.HolderSet<EntityType<?>>
types()
Returns the value of thetypes
record component.
-
Field Details
-
types
The field for thetypes
record component. -
CODEC
-
-
Constructor Details
-
EntityTypePredicate
Creates an instance of aEntityTypePredicate
record class.- Parameters:
types
- the value for thetypes
record component
-
-
Method Details
-
of
-
of
-
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)
. -
types
Returns the value of thetypes
record component.- Returns:
- the value of the
types
record component
-