Record Class DistancePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.DistancePredicate
public record DistancePredicate(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute)
extends Record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final MinMaxBounds.DoublesThe field for theabsoluterecord component.static final com.mojang.serialization.Codec<DistancePredicate>private final MinMaxBounds.DoublesThe field for thehorizontalrecord component.private final MinMaxBounds.DoublesThe field for thexrecord component.private final MinMaxBounds.DoublesThe field for theyrecord component.private final MinMaxBounds.DoublesThe field for thezrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionDistancePredicate(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute) Creates an instance of aDistancePredicaterecord class.
- 
Method SummaryModifier and TypeMethodDescriptionabsolute()Returns the value of theabsoluterecord component.static DistancePredicateabsolute(MinMaxBounds.Doubles p_148841_) final booleanIndicates whether some other object is "equal to" this one.static Optional<DistancePredicate>fromJson(com.google.gson.JsonElement p_26265_) final inthashCode()Returns a hash code value for this object.Returns the value of thehorizontalrecord component.static DistancePredicatehorizontal(MinMaxBounds.Doubles p_148837_) booleanmatches(double p_26256_, double p_26257_, double p_26258_, double p_26259_, double p_26260_, double p_26261_) com.google.gson.JsonElementfinal StringtoString()Returns a string representation of this record class.static DistancePredicatevertical(MinMaxBounds.Doubles p_148839_) x()Returns the value of thexrecord component.y()Returns the value of theyrecord component.z()Returns the value of thezrecord component.
- 
Field Details- 
xThe field for thexrecord component.
- 
yThe field for theyrecord component.
- 
zThe field for thezrecord component.
- 
horizontalThe field for thehorizontalrecord component.
- 
absoluteThe field for theabsoluterecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
DistancePredicatepublic DistancePredicate(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute) Creates an instance of aDistancePredicaterecord class.- Parameters:
- x- the value for the- xrecord component
- y- the value for the- yrecord component
- z- the value for the- zrecord component
- horizontal- the value for the- horizontalrecord component
- absolute- the value for the- absoluterecord component
 
 
- 
- 
Method Details- 
horizontal
- 
vertical
- 
absolute
- 
matchespublic boolean matches(double p_26256_, double p_26257_, double p_26258_, double p_26259_, double p_26260_, double p_26261_) 
- 
fromJson
- 
serializeToJsonpublic com.google.gson.JsonElement serializeToJson()
- 
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).
- 
xReturns the value of thexrecord component.- Returns:
- the value of the xrecord component
 
- 
yReturns the value of theyrecord component.- Returns:
- the value of the yrecord component
 
- 
zReturns the value of thezrecord component.- Returns:
- the value of the zrecord component
 
- 
horizontalReturns the value of thehorizontalrecord component.- Returns:
- the value of the horizontalrecord component
 
- 
absoluteReturns the value of theabsoluterecord component.- Returns:
- the value of the absoluterecord component
 
 
-