Class RunAwayTask<T>
- java.lang.Object
-
- net.minecraft.entity.ai.brain.task.Task<CreatureEntity>
-
- net.minecraft.entity.ai.brain.task.RunAwayTask<T>
-
public class RunAwayTask<T> extends Task<CreatureEntity>
-
-
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
desiredDistance
private float
speedModifier
private java.util.function.Function<T,Vector3d>
toPosition
private MemoryModuleType<T>
walkAwayFromMemory
-
Fields inherited from class net.minecraft.entity.ai.brain.task.Task
entryCondition
-
-
Constructor Summary
Constructors Constructor Description RunAwayTask(MemoryModuleType<T> p_i231533_1_, float p_i231533_2_, int p_i231533_3_, boolean p_i231533_4_, java.util.function.Function<T,Vector3d> p_i231533_5_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
alreadyWalkingAwayFromPosWithSameSpeed(CreatureEntity p_233964_1_)
protected boolean
checkExtraStartConditions(ServerWorld p_212832_1_, CreatureEntity p_212832_2_)
static RunAwayTask<? extends Entity>
entity(MemoryModuleType<? extends Entity> p_233965_0_, float p_233965_1_, int p_233965_2_, boolean p_233965_3_)
private Vector3d
getPosToAvoid(CreatureEntity p_233961_1_)
private static void
moveAwayFrom(CreatureEntity p_233962_0_, Vector3d p_233962_1_, float p_233962_2_)
static RunAwayTask<BlockPos>
pos(MemoryModuleType<BlockPos> p_233963_0_, float p_233963_1_, int p_233963_2_, boolean p_233963_3_)
protected void
start(ServerWorld p_212831_1_, CreatureEntity p_212831_2_, long p_212831_3_)
-
Methods inherited from class net.minecraft.entity.ai.brain.task.Task
canStillUse, doStop, getStatus, stop, tick, tickOrStop, timedOut, toString, tryStart
-
-
-
-
Field Detail
-
walkAwayFromMemory
private final MemoryModuleType<T> walkAwayFromMemory
-
speedModifier
private final float speedModifier
-
desiredDistance
private final int desiredDistance
-
-
Constructor Detail
-
RunAwayTask
public RunAwayTask(MemoryModuleType<T> p_i231533_1_, float p_i231533_2_, int p_i231533_3_, boolean p_i231533_4_, java.util.function.Function<T,Vector3d> p_i231533_5_)
-
-
Method Detail
-
pos
public static RunAwayTask<BlockPos> pos(MemoryModuleType<BlockPos> p_233963_0_, float p_233963_1_, int p_233963_2_, boolean p_233963_3_)
-
entity
public static RunAwayTask<? extends Entity> entity(MemoryModuleType<? extends Entity> p_233965_0_, float p_233965_1_, int p_233965_2_, boolean p_233965_3_)
-
checkExtraStartConditions
protected boolean checkExtraStartConditions(ServerWorld p_212832_1_, CreatureEntity p_212832_2_)
- Overrides:
checkExtraStartConditions
in classTask<CreatureEntity>
-
getPosToAvoid
private Vector3d getPosToAvoid(CreatureEntity p_233961_1_)
-
alreadyWalkingAwayFromPosWithSameSpeed
private boolean alreadyWalkingAwayFromPosWithSameSpeed(CreatureEntity p_233964_1_)
-
start
protected void start(ServerWorld p_212831_1_, CreatureEntity p_212831_2_, long p_212831_3_)
- Overrides:
start
in classTask<CreatureEntity>
-
moveAwayFrom
private static void moveAwayFrom(CreatureEntity p_233962_0_, Vector3d p_233962_1_, float p_233962_2_)
-
-