Class VillagerWalkTowardsTask
java.lang.Object
net.minecraft.entity.ai.brain.task.Task<VillagerEntity>
net.minecraft.entity.ai.brain.task.VillagerWalkTowardsTask
public class VillagerWalkTowardsTask extends Task<VillagerEntity>
-
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 intcompletionRangeprivate MemoryModuleType<GlobalPos>destinationprivate intmaxRangeprivate intmaxRunTimeprivate floatspeedFields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates -
Constructor Summary
Constructors Constructor Description VillagerWalkTowardsTask(MemoryModuleType<GlobalPos> destination, float speed, int completionRange, int maxRange, int maxRunTime) -
Method Summary
Modifier and Type Method Description private booleanexceedsMaxRange(VillagerEntity villagerEntity, GlobalPos globalPos)private voidgiveUp(VillagerEntity villager, long time)private booleanmethod_30952(ServerWorld serverWorld, GlobalPos globalPos)private booleanreachedDestination(ServerWorld world, VillagerEntity villager, GlobalPos pos)protected voidrun(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)private booleanshouldGiveUp(ServerWorld world, VillagerEntity villager)Methods inherited from class net.minecraft.entity.ai.brain.task.Task
finishRunning, getStatus, isTimeLimitExceeded, keepRunning, shouldKeepRunning, shouldRun, stop, tick, toString, tryStarting
-
Field Details
-
destination
-
speed
private final float speed -
completionRange
private final int completionRange -
maxRange
private final int maxRange -
maxRunTime
private final int maxRunTime
-
-
Constructor Details
-
VillagerWalkTowardsTask
public VillagerWalkTowardsTask(MemoryModuleType<GlobalPos> destination, float speed, int completionRange, int maxRange, int maxRunTime)
-
-
Method Details
-
giveUp
-
run
- Overrides:
runin classTask<VillagerEntity>
-
shouldGiveUp
-
exceedsMaxRange
-
method_30952
-
reachedDestination
-