public class EntityAINearestAttackableTarget<T extends EntityLivingBase> extends EntityAITarget
Modifier and Type | Class and Description |
---|---|
static class |
EntityAINearestAttackableTarget.Sorter |
Modifier and Type | Field and Description |
---|---|
protected EntityAINearestAttackableTarget.Sorter |
sorter |
private int |
targetChance |
protected java.lang.Class<T> |
targetClass |
protected T |
targetEntity |
protected com.google.common.base.Predicate<? super T> |
targetEntitySelector |
shouldCheckSight, target, taskOwner, unseenMemoryTicks
Constructor and Description |
---|
EntityAINearestAttackableTarget(EntityCreature creature,
java.lang.Class<T> classTarget,
boolean checkSight) |
EntityAINearestAttackableTarget(EntityCreature creature,
java.lang.Class<T> classTarget,
boolean checkSight,
boolean onlyNearby) |
EntityAINearestAttackableTarget(EntityCreature creature,
java.lang.Class<T> classTarget,
int chance,
boolean checkSight,
boolean onlyNearby,
com.google.common.base.Predicate<? super T> targetSelector) |
Modifier and Type | Method and Description |
---|---|
protected AxisAlignedBB |
getTargetableArea(double targetDistance) |
boolean |
shouldExecute() |
void |
startExecuting() |
getTargetDistance, isSuitableTarget, isSuitableTarget, resetTask, setUnseenMemoryTicks, shouldContinueExecuting
getMutexBits, isInterruptible, setMutexBits, updateTask
protected final java.lang.Class<T extends EntityLivingBase> targetClass
private final int targetChance
protected final EntityAINearestAttackableTarget.Sorter sorter
protected final com.google.common.base.Predicate<? super T extends EntityLivingBase> targetEntitySelector
protected T extends EntityLivingBase targetEntity
public EntityAINearestAttackableTarget(EntityCreature creature, java.lang.Class<T> classTarget, boolean checkSight)
public EntityAINearestAttackableTarget(EntityCreature creature, java.lang.Class<T> classTarget, boolean checkSight, boolean onlyNearby)
public EntityAINearestAttackableTarget(EntityCreature creature, java.lang.Class<T> classTarget, int chance, boolean checkSight, boolean onlyNearby, @Nullable com.google.common.base.Predicate<? super T> targetSelector)
public boolean shouldExecute()
shouldExecute
in class EntityAIBase
protected AxisAlignedBB getTargetableArea(double targetDistance)
public void startExecuting()
startExecuting
in class EntityAITarget