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
-
Field Summary
Fields Modifier and Type Field Description private intcompletionRangeprivate MemoryModuleType<GlobalPos>destinationprivate intmaxRangeprivate intmaxRunTimeprivate floatspeed -
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(ServerWorld world, VillagerEntity villager, GlobalPos pos)private voidgiveUp(VillagerEntity villager, long time)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
-
reachedDestination
-