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 @Nullable LivingEntityprotected intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionTargetGoal(Mob mob, boolean mustSee) TargetGoal(Mob mob, boolean mustSee, boolean mustReach) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanAttack(@Nullable LivingEntity target, TargetingConditions targetConditions) Checks if this is a suitable target.booleanprivate booleancanReach(LivingEntity target) Checks to see if this entity can find a short path to the given target.protected doublesetUnseenMemoryTicks(int unseenMemoryTicks) voidstart()voidstop()Methods inherited from class 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
-
stop
-
canAttack
Checks if this is a suitable target. -
canReach
Checks to see if this entity can find a short path to the given target. -
setUnseenMemoryTicks
-