Class InteractWithEntityTask<E extends LivingEntity,T extends LivingEntity>
- java.lang.Object
-
- net.minecraft.entity.ai.brain.task.Task<E>
-
- net.minecraft.entity.ai.brain.task.InteractWithEntityTask<E,T>
-
public class InteractWithEntityTask<E extends LivingEntity,T extends LivingEntity> extends Task<E>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.entity.ai.brain.task.Task
Task.Status
-
-
Field Summary
Fields Modifier and Type Field Description private int
interactionRangeSqr
private int
maxDist
private MemoryModuleType<T>
memory
private java.util.function.Predicate<E>
selfFilter
private float
speedModifier
private java.util.function.Predicate<T>
targetFilter
private EntityType<? extends T>
type
-
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
entryCondition
-
-
Constructor Summary
Constructors Constructor Description InteractWithEntityTask(EntityType<? extends T> p_i50363_1_, int p_i50363_2_, java.util.function.Predicate<E> p_i50363_3_, java.util.function.Predicate<T> p_i50363_4_, MemoryModuleType<T> p_i50363_5_, float p_i50363_6_, int p_i50363_7_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkExtraStartConditions(ServerWorld p_212832_1_, E p_212832_2_)
private boolean
isTargetValid(LivingEntity p_233914_1_)
static <T extends LivingEntity>
InteractWithEntityTask<LivingEntity,T>of(EntityType<? extends T> p_220445_0_, int p_220445_1_, MemoryModuleType<T> p_220445_2_, float p_220445_3_, int p_220445_4_)
private boolean
seesAtLeastOneValidTarget(E p_233913_1_)
protected void
start(ServerWorld p_212831_1_, E p_212831_2_, long p_212831_3_)
-
Methods inherited from class net.minecraft.entity.ai.brain.task.Task
canStillUse, doStop, getStatus, stop, tick, tickOrStop, timedOut, toString, tryStart
-
-
-
-
Field Detail
-
maxDist
private final int maxDist
-
speedModifier
private final float speedModifier
-
type
private final EntityType<? extends T extends LivingEntity> type
-
interactionRangeSqr
private final int interactionRangeSqr
-
targetFilter
private final java.util.function.Predicate<T extends LivingEntity> targetFilter
-
selfFilter
private final java.util.function.Predicate<E extends LivingEntity> selfFilter
-
memory
private final MemoryModuleType<T extends LivingEntity> memory
-
-
Constructor Detail
-
InteractWithEntityTask
public InteractWithEntityTask(EntityType<? extends T> p_i50363_1_, int p_i50363_2_, java.util.function.Predicate<E> p_i50363_3_, java.util.function.Predicate<T> p_i50363_4_, MemoryModuleType<T> p_i50363_5_, float p_i50363_6_, int p_i50363_7_)
-
-
Method Detail
-
of
public static <T extends LivingEntity> InteractWithEntityTask<LivingEntity,T> of(EntityType<? extends T> p_220445_0_, int p_220445_1_, MemoryModuleType<T> p_220445_2_, float p_220445_3_, int p_220445_4_)
-
checkExtraStartConditions
protected boolean checkExtraStartConditions(ServerWorld p_212832_1_, E p_212832_2_)
- Overrides:
checkExtraStartConditions
in classTask<E extends LivingEntity>
-
seesAtLeastOneValidTarget
private boolean seesAtLeastOneValidTarget(E p_233913_1_)
-
isTargetValid
private boolean isTargetValid(LivingEntity p_233914_1_)
-
start
protected void start(ServerWorld p_212831_1_, E p_212831_2_, long p_212831_3_)
- Overrides:
start
in classTask<E extends LivingEntity>
-
-