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 LivingEntityprotected TargetingConditionsThis filter is applied to the Entity search.Fields inherited from class net.minecraft.world.entity.ai.goal.target.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, Predicate<LivingEntity> targetPredicate) NearestAttackableTargetGoal(Mob mob, Class<T> targetType, int randomInterval, boolean mustSee, boolean mustReach, Predicate<LivingEntity> targetPredicate) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUse()protected voidprotected AABBgetTargetSearchArea(double targetDistance) voidsetTarget(LivingEntity target) voidstart()Methods inherited from class net.minecraft.world.entity.ai.goal.target.TargetGoal
canAttack, canContinueToUse, getFollowDistance, setUnseenMemoryTicks, stopMethods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, 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, Predicate<LivingEntity> targetPredicate) -
NearestAttackableTargetGoal
-
NearestAttackableTargetGoal
public NearestAttackableTargetGoal(Mob mob, Class<T> targetType, int randomInterval, boolean mustSee, boolean mustReach, @Nullable Predicate<LivingEntity> targetPredicate)
-
-
Method Details
-
canUse
public boolean canUse() -
getTargetSearchArea
-
findTarget
protected void findTarget() -
start
public void start()- Overrides:
startin classTargetGoal
-
setTarget
-