Class NearestAttackableTargetGoal<T extends LivingEntity>
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.target.TargetGoal
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<T>
- Direct Known Subclasses:
Bee.BeeBecomeAngryTargetGoal, EnderMan.EndermanLookForPlayerGoal, Fox.DefendTrustedTargetGoal, Llama.LlamaAttackWolfGoal, NearestAttackableWitchTargetGoal, NearestHealableRaiderTargetGoal, NonTameRandomTargetGoal, PolarBear.PolarBearAttackPlayersGoal, Shulker.ShulkerDefenseAttackGoal, Shulker.ShulkerNearestAttackGoal, Spider.SpiderTargetGoal, Vindicator.VindicatorJohnnyAttackGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprotected final intprotected @Nullable LivingEntityprotected final TargetingConditionsThis filter is applied to the Entity search.Fields inherited from class TargetGoal
mob, mustSee, targetMob, unseenMemoryTicks -
Constructor Summary
ConstructorsConstructorDescriptionNearestAttackableTargetGoal(Mob mob, Class<T> targetType, boolean mustSee) NearestAttackableTargetGoal(Mob mob, Class<T> targetType, boolean mustSee, boolean mustReach) NearestAttackableTargetGoal(Mob mob, Class<T> targetType, boolean mustSee, TargetingConditions.Selector selector) NearestAttackableTargetGoal(Mob mob, Class<T> targetType, int randomInterval, boolean mustSee, boolean mustReach, @Nullable TargetingConditions.Selector selector) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUse()protected voidprivate TargetingConditionsprotected AABBgetTargetSearchArea(double followDistance) voidsetTarget(@Nullable LivingEntity target) voidstart()Methods inherited from class TargetGoal
canAttack, canContinueToUse, getFollowDistance, setUnseenMemoryTicks, stopMethods inherited from class Goal
adjustedTickDelay, getFlags, getServerLevel, getServerLevel, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, tick, toString
-
Field Details
-
DEFAULT_RANDOM_INTERVAL
private static final int DEFAULT_RANDOM_INTERVAL- See Also:
-
targetType
-
randomInterval
protected final int randomInterval -
target
-
targetConditions
This filter is applied to the Entity search. Only matching entities will be targeted.
-
-
Constructor Details
-
NearestAttackableTargetGoal
-
NearestAttackableTargetGoal
public NearestAttackableTargetGoal(Mob mob, Class<T> targetType, boolean mustSee, TargetingConditions.Selector selector) -
NearestAttackableTargetGoal
-
NearestAttackableTargetGoal
public NearestAttackableTargetGoal(Mob mob, Class<T> targetType, int randomInterval, boolean mustSee, boolean mustReach, @Nullable TargetingConditions.Selector selector)
-
-
Method Details
-
canUse
-
getTargetSearchArea
-
findTarget
protected void findTarget() -
start
public void start()- Overrides:
startin classTargetGoal
-
setTarget
-
getTargetConditions
-