public class FindInteractionTargetTask extends Task<LivingEntity>
Task.Status
Modifier and Type | Field and Description |
---|---|
private EntityType<?> |
entityType |
private int |
maxSquaredDistance |
private Predicate<LivingEntity> |
predicate |
private Predicate<LivingEntity> |
shouldRunPredicate |
requiredMemoryStates
Constructor and Description |
---|
FindInteractionTargetTask(EntityType<?> entityType,
int maxDistance) |
FindInteractionTargetTask(EntityType<?> entityType,
int maxDistance,
Predicate<LivingEntity> shouldRunPredicate,
Predicate<LivingEntity> predicate) |
Modifier and Type | Method and Description |
---|---|
private List<LivingEntity> |
getVisibleMobs(LivingEntity entity) |
void |
run(ServerWorld world,
LivingEntity entity,
long time) |
boolean |
shouldRun(ServerWorld world,
LivingEntity entity) |
private boolean |
test(LivingEntity entity) |
finishRunning, getStatus, isTimeLimitExceeded, keepRunning, shouldKeepRunning, stop, tick, toString, tryStarting
private final EntityType<?> entityType
private final int maxSquaredDistance
private final Predicate<LivingEntity> predicate
private final Predicate<LivingEntity> shouldRunPredicate
public FindInteractionTargetTask(EntityType<?> entityType, int maxDistance, Predicate<LivingEntity> shouldRunPredicate, Predicate<LivingEntity> predicate)
public FindInteractionTargetTask(EntityType<?> entityType, int maxDistance)
public boolean shouldRun(ServerWorld world, LivingEntity entity)
shouldRun
in class Task<LivingEntity>
public void run(ServerWorld world, LivingEntity entity, long time)
run
in class Task<LivingEntity>
private boolean test(LivingEntity entity)
private List<LivingEntity> getVisibleMobs(LivingEntity entity)