Record Class DistanceToPlayerPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.predicates.entity.DistanceToPlayerPredicate
- All Implemented Interfaces:
EntitySubPredicate
public record DistanceToPlayerPredicate(DistancePredicate distance)
extends Record
implements EntitySubPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DistanceToPlayerPredicate> private final DistancePredicateThe field for thedistancerecord component.Fields inherited from interface EntitySubPredicate
ALWAYS_TRUE -
Constructor Summary
ConstructorsConstructorDescriptionDistanceToPlayerPredicate(DistancePredicate distance) Creates an instance of aDistanceToPlayerPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptiondistance()Returns the value of thedistancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(Entity entity, ServerLevel level, @Nullable Vec3 position) final StringtoString()Returns a string representation of this record class.Methods inherited from interface EntitySubPredicate
and
-
Field Details
-
distance
The field for thedistancerecord component. -
CODEC
-
-
Constructor Details
-
DistanceToPlayerPredicate
Creates an instance of aDistanceToPlayerPredicaterecord class.- Parameters:
distance- the value for thedistancerecord component
-
-
Method Details
-
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). -
distance
Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-