Record Class VehiclePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.predicates.entity.VehiclePredicate
- All Implemented Interfaces:
EntitySubPredicate
public record VehiclePredicate(EntityPredicate vehicle)
extends Record
implements EntitySubPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<VehiclePredicate> private final EntityPredicateThe field for thevehiclerecord component.Fields inherited from interface EntitySubPredicate
ALWAYS_TRUE -
Constructor Summary
ConstructorsConstructorDescriptionVehiclePredicate(EntityPredicate vehicle) Creates an instance of aVehiclePredicaterecord 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(Entity entity, ServerLevel level, @Nullable Vec3 position) final StringtoString()Returns a string representation of this record class.vehicle()Returns the value of thevehiclerecord component.Methods inherited from interface EntitySubPredicate
and
-
Field Details
-
vehicle
The field for thevehiclerecord component. -
CODEC
-
-
Constructor Details
-
VehiclePredicate
Creates an instance of aVehiclePredicaterecord class.- Parameters:
vehicle- the value for thevehiclerecord 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). -
vehicle
Returns the value of thevehiclerecord component.- Returns:
- the value of the
vehiclerecord component
-