Package net.minecraft.entity.ai.goal
Class FollowOwnerGoal
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.FollowOwnerGoal
public class FollowOwnerGoal extends Goal
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.goal.Goal
Goal.Control -
Field Summary
Fields Modifier and Type Field Description private booleanleavesAllowedprivate floatmaxDistanceprivate floatminDistanceprivate EntityNavigationnavigationprivate floatoldWaterPathfindingPenaltyprivate LivingEntityownerprivate doublespeedprivate TameableEntitytameableprivate intupdateCountdownTicksprivate WorldViewworld -
Constructor Summary
Constructors Constructor Description FollowOwnerGoal(TameableEntity tameable, double speed, float minDistance, float maxDistance, boolean leavesAllowed) -
Method Summary
Modifier and Type Method Description booleancanStart()private booleancanTeleportTo(BlockPos pos)private intgetRandomInt(int min, int max)booleanshouldContinue()voidstart()voidstop()voidtick()private voidtryTeleport()private booleantryTeleportTo(int x, int y, int z)Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, toString
-
Field Details
-
tameable
-
owner
-
world
-
speed
private final double speed -
updateCountdownTicks
private int updateCountdownTicks -
maxDistance
private final float maxDistance -
minDistance
private final float minDistance -
oldWaterPathfindingPenalty
private float oldWaterPathfindingPenalty -
leavesAllowed
private final boolean leavesAllowed
-
-
Constructor Details
-
FollowOwnerGoal
public FollowOwnerGoal(TameableEntity tameable, double speed, float minDistance, float maxDistance, boolean leavesAllowed)
-
-
Method Details
-
canStart
public boolean canStart() -
shouldContinue
public boolean shouldContinue()- Overrides:
shouldContinuein classGoal
-
start
public void start() -
stop
public void stop() -
tick
public void tick() -
tryTeleport
private void tryTeleport() -
tryTeleportTo
private boolean tryTeleportTo(int x, int y, int z) -
canTeleportTo
-
getRandomInt
private int getRandomInt(int min, int max)
-