Class HideInHomeTask
java.lang.Object
net.minecraft.entity.ai.brain.task.Task<LivingEntity>
net.minecraft.entity.ai.brain.task.HideInHomeTask
- Direct Known Subclasses:
HideInHomeDuringRaidTask
public class HideInHomeTask extends Task<LivingEntity>
-
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 Optional<BlockPos>
homePosition
private int
maxDistance
private int
preferredDistance
private float
walkSpeed
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
requiredMemoryStates
-
Constructor Summary
Constructors Constructor Description HideInHomeTask(int maxDistance, float walkSpeed, int preferredDistance)
-
Method Summary
Modifier and Type Method Description protected void
run(ServerWorld world, LivingEntity entity, long time)
protected boolean
shouldRun(ServerWorld world, LivingEntity entity)
Methods inherited from class net.minecraft.entity.ai.brain.task.Task
finishRunning, getStatus, isTimeLimitExceeded, keepRunning, shouldKeepRunning, stop, tick, toString, tryStarting
-
Field Details
-
walkSpeed
private final float walkSpeed -
maxDistance
private final int maxDistance -
preferredDistance
private final int preferredDistance -
homePosition
-
-
Constructor Details
-
HideInHomeTask
public HideInHomeTask(int maxDistance, float walkSpeed, int preferredDistance)
-
-
Method Details
-
shouldRun
- Overrides:
shouldRun
in classTask<LivingEntity>
-
run
- Overrides:
run
in classTask<LivingEntity>
-