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 intprivate static final intprivate static final intprotected final MobThe entity that this goal belongs toprivate final booleanprotected final booleanprivate intprivate intprotected LivingEntityprotected intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionTargetGoal(Mob pMob, boolean pMustSee) TargetGoal(Mob pMob, boolean pMustSee, boolean pMustReach) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanAttack(LivingEntity pPotentialTarget, TargetingConditions pTargetPredicate) Checks if this is a suitable target.booleanprivate booleancanReach(LivingEntity pTarget) Checks to see if this entity can find a short path to the given target.protected doublesetUnseenMemoryTicks(int pUnseenMemoryTicks) voidstart()voidstop()Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, canUse, getFlags, getServerLevel, getServerLevel, 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:
canContinueToUsein 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
-