记录类 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, DataComponentMatchers components)
extends Record
-
嵌套类概要
嵌套类修饰符和类型类说明static class
static final record
-
字段概要
字段修饰符和类型字段说明static final com.mojang.serialization.Codec
<ContextAwarePredicate> static final com.mojang.serialization.Codec
<EntityPredicate> private final DataComponentMatchers
components
记录组件的字段。private final Optional
<DistancePredicate> distanceToPlayer
记录组件的字段。private final Optional
<MobEffectsPredicate> effects
记录组件的字段。private final Optional
<EntityTypePredicate> entityType
记录组件的字段。private final Optional
<EntityEquipmentPredicate> equipment
记录组件的字段。private final Optional
<EntityFlagsPredicate> flags
记录组件的字段。private final EntityPredicate.LocationWrapper
location
记录组件的字段。private final Optional
<MovementPredicate> movement
记录组件的字段。private final Optional
<NbtPredicate> nbt
记录组件的字段。private final Optional
<EntityPredicate> passenger
记录组件的字段。periodicTick
记录组件的字段。private final Optional
<SlotsPredicate> slots
记录组件的字段。private final Optional
<EntitySubPredicate> subPredicate
记录组件的字段。private final Optional
<EntityPredicate> targetedEntity
记录组件的字段。team
记录组件的字段。private final Optional
<EntityPredicate> vehicle
记录组件的字段。 -
构造器概要
构造器构造器说明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, DataComponentMatchers components) 创建EntityPredicate
记录类的实例。 -
方法概要
修饰符和类型方法说明返回components
记录组件的值。static LootContext
createContext
(ServerPlayer p_36617_, Entity p_36618_) 返回distanceToPlayer
记录组件的值。effects()
返回effects
记录组件的值。返回entityType
记录组件的值。final boolean
指示某个其他对象是否“等于”此对象。返回equipment
记录组件的值。flags()
返回flags
记录组件的值。final int
hashCode()
返回此对象的哈希代码值。location()
返回location
记录组件的值。boolean
matches
(ServerLevel p_36608_, Vec3 p_36609_, Entity p_36610_) boolean
matches
(ServerPlayer p_36612_, Entity p_36613_) movement()
返回movement
记录组件的值。nbt()
返回nbt
记录组件的值。返回passenger
记录组件的值。返回periodicTick
记录组件的值。slots()
返回slots
记录组件的值。返回subPredicate
记录组件的值。返回targetedEntity
记录组件的值。team()
返回team
记录组件的值。final String
toString()
返回此记录类的字符串表示形式。vehicle()
返回vehicle
记录组件的值。static Optional
<ContextAwarePredicate> wrap
(Optional<EntityPredicate> p_298604_) static ContextAwarePredicate
wrap
(EntityPredicate p_286570_) static ContextAwarePredicate
wrap
(EntityPredicate.Builder p_298222_) static List
<ContextAwarePredicate> wrap
(EntityPredicate.Builder... p_298584_)
-
字段详细资料
-
entityType
entityType
记录组件的字段。 -
distanceToPlayer
distanceToPlayer
记录组件的字段。 -
movement
movement
记录组件的字段。 -
location
location
记录组件的字段。 -
effects
effects
记录组件的字段。 -
nbt
nbt
记录组件的字段。 -
flags
flags
记录组件的字段。 -
equipment
equipment
记录组件的字段。 -
subPredicate
subPredicate
记录组件的字段。 -
periodicTick
periodicTick
记录组件的字段。 -
vehicle
vehicle
记录组件的字段。 -
passenger
passenger
记录组件的字段。 -
targetedEntity
targetedEntity
记录组件的字段。 -
team
team
记录组件的字段。 -
slots
slots
记录组件的字段。 -
components
components
记录组件的字段。 -
CODEC
-
ADVANCEMENT_CODEC
-
-
构造器详细资料
-
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, DataComponentMatchers components) 创建EntityPredicate
记录类的实例。- 参数:
entityType
-entityType
记录组件的值distanceToPlayer
-distanceToPlayer
记录组件的值movement
-movement
记录组件的值location
-location
记录组件的值effects
-effects
记录组件的值nbt
-nbt
记录组件的值flags
-flags
记录组件的值equipment
-equipment
记录组件的值subPredicate
-subPredicate
记录组件的值periodicTick
-periodicTick
记录组件的值vehicle
-vehicle
记录组件的值passenger
-passenger
记录组件的值targetedEntity
-targetedEntity
记录组件的值team
-team
记录组件的值slots
-slots
记录组件的值components
-components
记录组件的值
-
-
方法详细资料
-
wrap
-
wrap
-
wrap
-
wrap
-
matches
-
matches
-
createContext
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)
进行比较。 -
entityType
返回entityType
记录组件的值。- 返回:
entityType
记录组件的值
-
distanceToPlayer
返回distanceToPlayer
记录组件的值。- 返回:
distanceToPlayer
记录组件的值
-
movement
返回movement
记录组件的值。- 返回:
movement
记录组件的值
-
location
返回location
记录组件的值。- 返回:
location
记录组件的值
-
effects
返回effects
记录组件的值。- 返回:
effects
记录组件的值
-
nbt
返回nbt
记录组件的值。- 返回:
nbt
记录组件的值
-
flags
返回flags
记录组件的值。- 返回:
flags
记录组件的值
-
equipment
返回equipment
记录组件的值。- 返回:
equipment
记录组件的值
-
subPredicate
返回subPredicate
记录组件的值。- 返回:
subPredicate
记录组件的值
-
periodicTick
返回periodicTick
记录组件的值。- 返回:
periodicTick
记录组件的值
-
vehicle
返回vehicle
记录组件的值。- 返回:
vehicle
记录组件的值
-
passenger
返回passenger
记录组件的值。- 返回:
passenger
记录组件的值
-
targetedEntity
返回targetedEntity
记录组件的值。- 返回:
targetedEntity
记录组件的值
-
team
返回team
记录组件的值。- 返回:
team
记录组件的值
-
slots
返回slots
记录组件的值。- 返回:
slots
记录组件的值
-
components
返回components
记录组件的值。- 返回:
components
记录组件的值
-