Record Class EntityPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityPredicate
public record EntityPredicate(Optional<EntityTypePredicate> entityType, Optional<DistancePredicate> distanceToPlayer, Optional<MovementPredicate> movement, EntityPredicate.LocationWrapper location, Optional<MobEffectsPredicate> effects, Optional<NbtPredicate> nbt, Optional<EntityFlagsPredicate> flags, Optional<EntityEquipmentPredicate> equipment, Optional<EntitySubPredicate> subPredicate, Optional<Integer> periodicTick, Optional<EntityPredicate> vehicle, Optional<EntityPredicate> passenger, Optional<EntityPredicate> targetedEntity, Optional<String> team, Optional<SlotsPredicate> slots)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final record -
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 EntityPredicate.LocationWrapperThe field for thelocationrecord component.private final Optional<MovementPredicate> The field for themovementrecord component.private final Optional<NbtPredicate> The field for thenbtrecord component.private final Optional<EntityPredicate> The field for thepassengerrecord component.The field for theperiodicTickrecord component.private final Optional<SlotsPredicate> The field for theslotsrecord 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<MovementPredicate> movement, EntityPredicate.LocationWrapper location, Optional<MobEffectsPredicate> effects, Optional<NbtPredicate> nbt, Optional<EntityFlagsPredicate> flags, Optional<EntityEquipmentPredicate> equipment, Optional<EntitySubPredicate> subPredicate, Optional<Integer> periodicTick, 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_) movement()Returns the value of themovementrecord component.nbt()Returns the value of thenbtrecord component.Returns the value of thepassengerrecord component.Returns the value of theperiodicTickrecord component.slots()Returns the value of theslotsrecord 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. -
movement
The field for themovementrecord component. -
location
The field for thelocationrecord 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. -
periodicTick
The field for theperiodicTickrecord 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<MovementPredicate> movement, EntityPredicate.LocationWrapper location, Optional<MobEffectsPredicate> effects, Optional<NbtPredicate> nbt, Optional<EntityFlagsPredicate> flags, Optional<EntityEquipmentPredicate> equipment, Optional<EntitySubPredicate> subPredicate, Optional<Integer> periodicTick, 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 componentmovement- the value for themovementrecord componentlocation- the value for thelocationrecord 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 componentperiodicTick- the value for theperiodicTickrecord 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
-
movement
Returns the value of themovementrecord component.- Returns:
- the value of the
movementrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord 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
-
periodicTick
Returns the value of theperiodicTickrecord component.- Returns:
- the value of the
periodicTickrecord 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
-