Class FindEntityTask<E extends LivingEntity,T extends LivingEntity>
java.lang.Object
net.minecraft.entity.ai.brain.task.Task<E>
net.minecraft.entity.ai.brain.task.FindEntityTask<E,T>
public class FindEntityTask<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
completionRange
private EntityType<? extends T>
entityType
private int
maxSquaredDistance
private Predicate<T>
predicate
private Predicate<E>
shouldRunPredicate
private float
speed
private MemoryModuleType<T>
targetModule
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates
-
Constructor Summary
Constructors Constructor Description FindEntityTask(EntityType<? extends T> entityType, int maxDistance, Predicate<E> shouldRunPredicate, Predicate<T> predicate, MemoryModuleType<T> targetModule, float speed, int completionRange)
-
Method Summary
Modifier and Type Method Description static <T extends LivingEntity>
FindEntityTask<LivingEntity,T>create(EntityType<? extends T> entityType, int maxDistance, MemoryModuleType<T> targetModule, float speed, int completionRange)
private boolean
method_24582(E e)
private boolean
method_24583(LivingEntity livingEntity)
protected void
run(ServerWorld world, E entity, long time)
protected boolean
shouldRun(ServerWorld world, E entity)
Methods inherited from class net.minecraft.entity.ai.brain.task.Task
finishRunning, getStatus, isTimeLimitExceeded, keepRunning, shouldKeepRunning, stop, tick, toString, tryStarting
-
Field Details
-
completionRange
private final int completionRange -
speed
private final float speed -
entityType
-
maxSquaredDistance
private final int maxSquaredDistance -
predicate
-
shouldRunPredicate
-
targetModule
-
-
Constructor Details
-
FindEntityTask
public FindEntityTask(EntityType<? extends T> entityType, int maxDistance, Predicate<E> shouldRunPredicate, Predicate<T> predicate, MemoryModuleType<T> targetModule, float speed, int completionRange)
-
-
Method Details
-
create
public static <T extends LivingEntity> FindEntityTask<LivingEntity,T> create(EntityType<? extends T> entityType, int maxDistance, MemoryModuleType<T> targetModule, float speed, int completionRange) -
shouldRun
- Overrides:
shouldRun
in classTask<E extends LivingEntity>
-
method_24582
-
method_24583
-
run
- Overrides:
run
in classTask<E extends LivingEntity>
-