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)
extends Record
- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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<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) 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.private static Optional<ContextAwarePredicate>fromElement(String p_286569_, DeserializationContext p_286821_, com.google.gson.JsonElement p_286582_) static Optional<EntityPredicate>fromJson(com.google.gson.JsonElement p_297667_) static Optional<ContextAwarePredicate>fromJson(com.google.gson.JsonObject p_300195_, String p_297866_, DeserializationContext p_301262_) static List<ContextAwarePredicate>fromJsonArray(com.google.gson.JsonObject p_286850_, String p_286682_, DeserializationContext p_286876_) 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.com.google.gson.JsonElementReturns 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_300980_) static ContextAwarePredicatewrap(EntityPredicate p_286570_) static ContextAwarePredicatewrap(EntityPredicate.Builder p_298584_) static List<ContextAwarePredicate>wrap(EntityPredicate.Builder... p_299692_)  
- 
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. - 
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) 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 component
 
 - 
 - 
Method Details
- 
fromJson
public static Optional<ContextAwarePredicate> fromJson(com.google.gson.JsonObject p_300195_, String p_297866_, DeserializationContext p_301262_)  - 
fromJsonArray
public static List<ContextAwarePredicate> fromJsonArray(com.google.gson.JsonObject p_286850_, String p_286682_, DeserializationContext p_286876_)  - 
fromElement
private static Optional<ContextAwarePredicate> fromElement(String p_286569_, DeserializationContext p_286821_, @Nullable com.google.gson.JsonElement p_286582_)  - 
wrap
 - 
wrap
 - 
wrap
 - 
wrap
 - 
matches
 - 
matches
 - 
fromJson
 - 
serializeToJson
public com.google.gson.JsonElement serializeToJson() - 
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 
 
 -