Class TargetGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.target.TargetGoal
- Direct Known Subclasses:
DefendVillageTargetGoal
,HurtByTargetGoal
,NearestAttackableTargetGoal
,OwnerHurtByTargetGoal
,OwnerHurtTargetGoal
,TraderLlama.TraderLlamaDefendWanderingTraderGoal
,Vex.VexCopyOwnerTargetGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
protected final Mob
The entity that this goal belongs toprivate final boolean
protected final boolean
private int
private int
protected LivingEntity
protected int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionTargetGoal
(Mob pMob, boolean pMustSee) TargetGoal
(Mob pMob, boolean pMustSee, boolean pMustReach) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canAttack
(LivingEntity pPotentialTarget, TargetingConditions pTargetPredicate) Checks if this is a suitable target.boolean
private boolean
canReach
(LivingEntity pTarget) Checks to see if this entity can find a short path to the given target.protected double
setUnseenMemoryTicks
(int pUnseenMemoryTicks) void
start()
void
stop()
Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, canUse, getFlags, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, tick, toString
-
Field Details
-
EMPTY_REACH_CACHE
private static final int EMPTY_REACH_CACHE- See Also:
-
CAN_REACH_CACHE
private static final int CAN_REACH_CACHE- See Also:
-
CANT_REACH_CACHE
private static final int CANT_REACH_CACHE- See Also:
-
mob
The entity that this goal belongs to -
mustSee
protected final boolean mustSee -
mustReach
private final boolean mustReach -
reachCache
private int reachCache -
reachCacheTime
private int reachCacheTime -
unseenTicks
private int unseenTicks -
targetMob
-
unseenMemoryTicks
protected int unseenMemoryTicks
-
-
Constructor Details
-
TargetGoal
-
TargetGoal
-
-
Method Details
-
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUse
in classGoal
-
getFollowDistance
protected double getFollowDistance() -
start
public void start() -
stop
public void stop() -
canAttack
protected boolean canAttack(@Nullable LivingEntity pPotentialTarget, TargetingConditions pTargetPredicate) Checks if this is a suitable target. -
canReach
Checks to see if this entity can find a short path to the given target. -
setUnseenMemoryTicks
-