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 int
completionRange
private MemoryModuleType<GlobalPos>
destination
private int
maxRange
private int
maxRunTime
private float
speed
Fields 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 boolean
exceedsMaxRange(VillagerEntity villagerEntity, GlobalPos globalPos)
private void
giveUp(VillagerEntity villager, long time)
private boolean
method_30952(ServerWorld serverWorld, GlobalPos globalPos)
private boolean
reachedDestination(ServerWorld world, VillagerEntity villager, GlobalPos pos)
protected void
run(ServerWorld serverWorld, VillagerEntity villagerEntity, long long2)
private boolean
shouldGiveUp(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:
run
in classTask<VillagerEntity>
-
shouldGiveUp
-
exceedsMaxRange
-
method_30952
-
reachedDestination
-