Package net.minecraft.entity.ai.goal
Class NearestAttackableTargetGoal<T extends LivingEntity>
- java.lang.Object
-
- net.minecraft.entity.ai.goal.Goal
-
- net.minecraft.entity.ai.goal.TargetGoal
-
- net.minecraft.entity.ai.goal.NearestAttackableTargetGoal<T>
-
- Direct Known Subclasses:
BeeEntity.AttackPlayerGoal
,EndermanEntity.FindPlayerGoal
,FoxEntity.RevengeGoal
,LlamaEntity.DefendTargetGoal
,NearestAttackableTargetExpiringGoal
,NonTamedTargetGoal
,PolarBearEntity.AttackPlayerGoal
,ShulkerEntity.AttackNearestGoal
,ShulkerEntity.DefenseAttackGoal
,SpiderEntity.TargetGoal
,ToggleableNearestAttackableTargetGoal
,VindicatorEntity.JohnnyAttackGoal
public class NearestAttackableTargetGoal<T extends LivingEntity> extends TargetGoal
-
-
Field Summary
Fields Modifier and Type Field Description protected int
randomInterval
protected LivingEntity
target
protected EntityPredicate
targetConditions
protected java.lang.Class<T>
targetType
-
Fields inherited from class net.minecraft.entity.ai.goal.TargetGoal
mob, mustSee, targetMob, unseenMemoryTicks
-
-
Constructor Summary
Constructors Constructor Description NearestAttackableTargetGoal(MobEntity p_i50313_1_, java.lang.Class<T> p_i50313_2_, boolean p_i50313_3_)
NearestAttackableTargetGoal(MobEntity p_i50314_1_, java.lang.Class<T> p_i50314_2_, boolean p_i50314_3_, boolean p_i50314_4_)
NearestAttackableTargetGoal(MobEntity p_i50315_1_, java.lang.Class<T> p_i50315_2_, int p_i50315_3_, boolean p_i50315_4_, boolean p_i50315_5_, java.util.function.Predicate<LivingEntity> p_i50315_6_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canUse()
protected void
findTarget()
protected AxisAlignedBB
getTargetSearchArea(double p_188511_1_)
void
setTarget(LivingEntity p_234054_1_)
void
start()
-
Methods inherited from class net.minecraft.entity.ai.goal.TargetGoal
canAttack, canContinueToUse, getFollowDistance, setUnseenMemoryTicks, stop
-
-
-
-
Field Detail
-
targetType
protected final java.lang.Class<T extends LivingEntity> targetType
-
randomInterval
protected final int randomInterval
-
target
protected LivingEntity target
-
targetConditions
protected EntityPredicate targetConditions
-
-
Constructor Detail
-
NearestAttackableTargetGoal
public NearestAttackableTargetGoal(MobEntity p_i50313_1_, java.lang.Class<T> p_i50313_2_, boolean p_i50313_3_)
-
NearestAttackableTargetGoal
public NearestAttackableTargetGoal(MobEntity p_i50314_1_, java.lang.Class<T> p_i50314_2_, boolean p_i50314_3_, boolean p_i50314_4_)
-
NearestAttackableTargetGoal
public NearestAttackableTargetGoal(MobEntity p_i50315_1_, java.lang.Class<T> p_i50315_2_, int p_i50315_3_, boolean p_i50315_4_, boolean p_i50315_5_, @Nullable java.util.function.Predicate<LivingEntity> p_i50315_6_)
-
-
Method Detail
-
getTargetSearchArea
protected AxisAlignedBB getTargetSearchArea(double p_188511_1_)
-
findTarget
protected void findTarget()
-
start
public void start()
- Overrides:
start
in classTargetGoal
-
setTarget
public void setTarget(@Nullable LivingEntity p_234054_1_)
-
-