Record Class EntityPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityPredicate
public record EntityPredicate(Optional<EntityTypePredicate> entityType, Optional<DistancePredicate> distanceToPlayer, Optional<LocationPredicate> location, Optional<LocationPredicate> steppingOnLocation, Optional<MobEffectsPredicate> effects, Optional<NbtPredicate> nbt, Optional<EntityFlagsPredicate> flags, Optional<EntityEquipmentPredicate> equipment, Optional<EntitySubPredicate> subPredicate, Optional<EntityPredicate> vehicle, Optional<EntityPredicate> passenger, Optional<EntityPredicate> targetedEntity, Optional<String> team, Optional<SlotsPredicate> slots)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ContextAwarePredicate> static final com.mojang.serialization.Codec<EntityPredicate> private final Optional<DistancePredicate> The field for thedistanceToPlayerrecord component.private final Optional<MobEffectsPredicate> The field for theeffectsrecord component.private final Optional<EntityTypePredicate> The field for theentityTyperecord component.private final Optional<EntityEquipmentPredicate> The field for theequipmentrecord component.private final Optional<EntityFlagsPredicate> The field for theflagsrecord component.private final Optional<LocationPredicate> The field for thelocationrecord component.private final Optional<NbtPredicate> The field for thenbtrecord component.private final Optional<EntityPredicate> The field for thepassengerrecord component.private final Optional<SlotsPredicate> The field for theslotsrecord component.private final Optional<LocationPredicate> The field for thesteppingOnLocationrecord component.private final Optional<EntitySubPredicate> The field for thesubPredicaterecord component.private final Optional<EntityPredicate> The field for thetargetedEntityrecord component.The field for theteamrecord component.private final Optional<EntityPredicate> The field for thevehiclerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionEntityPredicate(Optional<EntityTypePredicate> entityType, Optional<DistancePredicate> distanceToPlayer, Optional<LocationPredicate> location, Optional<LocationPredicate> steppingOnLocation, Optional<MobEffectsPredicate> effects, Optional<NbtPredicate> nbt, Optional<EntityFlagsPredicate> flags, Optional<EntityEquipmentPredicate> equipment, Optional<EntitySubPredicate> subPredicate, Optional<EntityPredicate> vehicle, Optional<EntityPredicate> passenger, Optional<EntityPredicate> targetedEntity, Optional<String> team, Optional<SlotsPredicate> slots) Creates an instance of aEntityPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic LootContextcreateContext(ServerPlayer p_36617_, Entity p_36618_) Returns the value of thedistanceToPlayerrecord component.effects()Returns the value of theeffectsrecord component.Returns the value of theentityTyperecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theequipmentrecord component.flags()Returns the value of theflagsrecord component.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.booleanmatches(ServerLevel p_36608_, Vec3 p_36609_, Entity p_36610_) booleanmatches(ServerPlayer p_36612_, Entity p_36613_) nbt()Returns the value of thenbtrecord component.Returns the value of thepassengerrecord component.slots()Returns the value of theslotsrecord component.Returns the value of thesteppingOnLocationrecord component.Returns the value of thesubPredicaterecord component.Returns the value of thetargetedEntityrecord component.team()Returns the value of theteamrecord component.final StringtoString()Returns a string representation of this record class.vehicle()Returns the value of thevehiclerecord component.static Optional<ContextAwarePredicate> wrap(Optional<EntityPredicate> p_298604_) static ContextAwarePredicatewrap(EntityPredicate p_286570_) static ContextAwarePredicatewrap(EntityPredicate.Builder p_298222_) static List<ContextAwarePredicate> wrap(EntityPredicate.Builder... p_298584_)
-
Field Details
-
entityType
The field for theentityTyperecord component. -
distanceToPlayer
The field for thedistanceToPlayerrecord component. -
location
The field for thelocationrecord component. -
steppingOnLocation
The field for thesteppingOnLocationrecord component. -
effects
The field for theeffectsrecord component. -
nbt
The field for thenbtrecord component. -
flags
The field for theflagsrecord component. -
equipment
The field for theequipmentrecord component. -
subPredicate
The field for thesubPredicaterecord component. -
vehicle
The field for thevehiclerecord component. -
passenger
The field for thepassengerrecord component. -
targetedEntity
The field for thetargetedEntityrecord component. -
team
The field for theteamrecord component. -
slots
The field for theslotsrecord component. -
CODEC
-
ADVANCEMENT_CODEC
-
-
Constructor Details
-
EntityPredicate
public EntityPredicate(Optional<EntityTypePredicate> entityType, Optional<DistancePredicate> distanceToPlayer, Optional<LocationPredicate> location, Optional<LocationPredicate> steppingOnLocation, Optional<MobEffectsPredicate> effects, Optional<NbtPredicate> nbt, Optional<EntityFlagsPredicate> flags, Optional<EntityEquipmentPredicate> equipment, Optional<EntitySubPredicate> subPredicate, Optional<EntityPredicate> vehicle, Optional<EntityPredicate> passenger, Optional<EntityPredicate> targetedEntity, Optional<String> team, Optional<SlotsPredicate> slots) Creates an instance of aEntityPredicaterecord class.- Parameters:
entityType- the value for theentityTyperecord componentdistanceToPlayer- the value for thedistanceToPlayerrecord componentlocation- the value for thelocationrecord componentsteppingOnLocation- the value for thesteppingOnLocationrecord componenteffects- the value for theeffectsrecord componentnbt- the value for thenbtrecord componentflags- the value for theflagsrecord componentequipment- the value for theequipmentrecord componentsubPredicate- the value for thesubPredicaterecord componentvehicle- the value for thevehiclerecord componentpassenger- the value for thepassengerrecord componenttargetedEntity- the value for thetargetedEntityrecord componentteam- the value for theteamrecord componentslots- the value for theslotsrecord component
-
-
Method Details
-
wrap
-
wrap
-
wrap
-
wrap
-
matches
-
matches
-
createContext
-
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). -
entityType
Returns the value of theentityTyperecord component.- Returns:
- the value of the
entityTyperecord component
-
distanceToPlayer
Returns the value of thedistanceToPlayerrecord component.- Returns:
- the value of the
distanceToPlayerrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
steppingOnLocation
Returns the value of thesteppingOnLocationrecord component.- Returns:
- the value of the
steppingOnLocationrecord component
-
effects
Returns the value of theeffectsrecord component.- Returns:
- the value of the
effectsrecord component
-
nbt
Returns the value of thenbtrecord component.- Returns:
- the value of the
nbtrecord component
-
flags
Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-
equipment
Returns the value of theequipmentrecord component.- Returns:
- the value of the
equipmentrecord component
-
subPredicate
Returns the value of thesubPredicaterecord component.- Returns:
- the value of the
subPredicaterecord component
-
vehicle
Returns the value of thevehiclerecord component.- Returns:
- the value of the
vehiclerecord component
-
passenger
Returns the value of thepassengerrecord component.- Returns:
- the value of the
passengerrecord component
-
targetedEntity
Returns the value of thetargetedEntityrecord component.- Returns:
- the value of the
targetedEntityrecord component
-
team
Returns the value of theteamrecord component.- Returns:
- the value of the
teamrecord component
-
slots
Returns the value of theslotsrecord component.- Returns:
- the value of the
slotsrecord component
-