Package net.minecraft.entity.ai.goal
Class FollowTargetGoal<T extends LivingEntity>
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.TrackTargetGoal
net.minecraft.entity.ai.goal.FollowTargetGoal<T>
- Direct Known Subclasses:
BeeEntity.BeeFollowTargetGoal
,DisableableFollowTargetGoal
,EndermanEntity.TeleportTowardsPlayerGoal
,FollowTargetIfTamedGoal
,FoxEntity.DefendFriendGoal
,LlamaEntity.ChaseWolvesGoal
,PolarBearEntity.FollowPlayersGoal
,RaidGoal
,ShulkerEntity.SearchForPlayerGoal
,ShulkerEntity.SearchForTargetGoal
,SpiderEntity.FollowTargetGoal
,VindicatorEntity.FollowEntityGoal
public class FollowTargetGoal<T extends LivingEntity> extends TrackTargetGoal
-
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 protected int
reciprocalChance
protected Class<T>
targetClass
protected LivingEntity
targetEntity
protected TargetPredicate
targetPredicate
Fields inherited from class net.minecraft.entity.ai.goal.TrackTargetGoal
checkVisibility, maxTimeWithoutVisibility, mob, target
-
Constructor Summary
Constructors Constructor Description FollowTargetGoal(MobEntity mob, Class<T> targetClass, boolean checkVisibility)
FollowTargetGoal(MobEntity mob, Class<T> targetClass, boolean checkVisibility, boolean checkCanNavigate)
FollowTargetGoal(MobEntity mob, Class<T> targetClass, int reciprocalChance, boolean checkVisibility, boolean checkCanNavigate, Predicate<LivingEntity> targetPredicate)
-
Method Summary
Modifier and Type Method Description boolean
canStart()
protected void
findClosestTarget()
protected Box
getSearchBox(double distance)
void
setTargetEntity(LivingEntity targetEntity)
void
start()
Methods inherited from class net.minecraft.entity.ai.goal.TrackTargetGoal
canTrack, getFollowRange, setMaxTimeWithoutVisibility, shouldContinue, stop
Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, tick, toString
-
Field Details
-
targetClass
-
reciprocalChance
protected final int reciprocalChance -
targetEntity
-
targetPredicate
-
-
Constructor Details
-
FollowTargetGoal
-
FollowTargetGoal
-
FollowTargetGoal
-
-
Method Details
-
canStart
public boolean canStart() -
getSearchBox
-
findClosestTarget
protected void findClosestTarget() -
start
public void start()- Overrides:
start
in classTrackTargetGoal
-
setTargetEntity
-