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 intreciprocalChanceprotected Class<T>targetClassprotected LivingEntitytargetEntityprotected TargetPredicatetargetPredicateFields 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 booleancanStart()protected voidfindClosestTarget()protected BoxgetSearchBox(double distance)voidsetTargetEntity(LivingEntity targetEntity)voidstart()Methods inherited from class net.minecraft.entity.ai.goal.TrackTargetGoal
canTrack, getFollowRange, setMaxTimeWithoutVisibility, shouldContinue, stopMethods 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:
startin classTrackTargetGoal
-
setTargetEntity
-