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 SummaryNested Classes
- 
Field SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionEntityPredicate(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 SummaryModifier 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- 
entityTypeThe field for theentityTyperecord component.
- 
distanceToPlayerThe field for thedistanceToPlayerrecord component.
- 
locationThe field for thelocationrecord component.
- 
steppingOnLocationThe field for thesteppingOnLocationrecord component.
- 
effectsThe field for theeffectsrecord component.
- 
nbtThe field for thenbtrecord component.
- 
flagsThe field for theflagsrecord component.
- 
equipmentThe field for theequipmentrecord component.
- 
subPredicateThe field for thesubPredicaterecord component.
- 
vehicleThe field for thevehiclerecord component.
- 
passengerThe field for thepassengerrecord component.
- 
targetedEntityThe field for thetargetedEntityrecord component.
- 
teamThe field for theteamrecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
EntityPredicatepublic 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 the- entityTyperecord component
- distanceToPlayer- the value for the- distanceToPlayerrecord component
- location- the value for the- locationrecord component
- steppingOnLocation- the value for the- steppingOnLocationrecord component
- effects- the value for the- effectsrecord component
- nbt- the value for the- nbtrecord component
- flags- the value for the- flagsrecord component
- equipment- the value for the- equipmentrecord component
- subPredicate- the value for the- subPredicaterecord component
- vehicle- the value for the- vehiclerecord component
- passenger- the value for the- passengerrecord component
- targetedEntity- the value for the- targetedEntityrecord component
- team- the value for the- teamrecord component
 
 
- 
- 
Method Details- 
fromJsonpublic static Optional<ContextAwarePredicate> fromJson(com.google.gson.JsonObject p_300195_, String p_297866_, DeserializationContext p_301262_) 
- 
fromJsonArraypublic static List<ContextAwarePredicate> fromJsonArray(com.google.gson.JsonObject p_286850_, String p_286682_, DeserializationContext p_286876_) 
- 
fromElementprivate static Optional<ContextAwarePredicate> fromElement(String p_286569_, DeserializationContext p_286821_, @Nullable com.google.gson.JsonElement p_286582_) 
- 
wrap
- 
wrap
- 
wrap
- 
wrap
- 
matches
- 
matches
- 
fromJson
- 
serializeToJsonpublic com.google.gson.JsonElement serializeToJson()
- 
createContext
- 
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).
- 
entityTypeReturns the value of theentityTyperecord component.- Returns:
- the value of the entityTyperecord component
 
- 
distanceToPlayerReturns the value of thedistanceToPlayerrecord component.- Returns:
- the value of the distanceToPlayerrecord component
 
- 
locationReturns the value of thelocationrecord component.- Returns:
- the value of the locationrecord component
 
- 
steppingOnLocationReturns the value of thesteppingOnLocationrecord component.- Returns:
- the value of the steppingOnLocationrecord component
 
- 
effectsReturns the value of theeffectsrecord component.- Returns:
- the value of the effectsrecord component
 
- 
nbtReturns the value of thenbtrecord component.- Returns:
- the value of the nbtrecord component
 
- 
flagsReturns the value of theflagsrecord component.- Returns:
- the value of the flagsrecord component
 
- 
equipmentReturns the value of theequipmentrecord component.- Returns:
- the value of the equipmentrecord component
 
- 
subPredicateReturns the value of thesubPredicaterecord component.- Returns:
- the value of the subPredicaterecord component
 
- 
vehicleReturns the value of thevehiclerecord component.- Returns:
- the value of the vehiclerecord component
 
- 
passengerReturns the value of thepassengerrecord component.- Returns:
- the value of the passengerrecord component
 
- 
targetedEntityReturns the value of thetargetedEntityrecord component.- Returns:
- the value of the targetedEntityrecord component
 
- 
teamReturns the value of theteamrecord component.- Returns:
- the value of the teamrecord component
 
 
-