public class NearestAttackableTargetGoal<T extends LivingEntity> extends TargetGoal
Modifier and Type | Field and Description |
---|---|
protected LivingEntity |
nearestTarget |
protected int |
targetChance |
protected java.lang.Class<T> |
targetClass |
protected EntityPredicate |
targetEntitySelector |
goalOwner, shouldCheckSight, target, unseenMemoryTicks
Constructor and Description |
---|
NearestAttackableTargetGoal(MobEntity goalOwnerIn,
java.lang.Class<T> targetClassIn,
boolean checkSight) |
NearestAttackableTargetGoal(MobEntity goalOwnerIn,
java.lang.Class<T> targetClassIn,
boolean checkSight,
boolean nearbyOnlyIn) |
NearestAttackableTargetGoal(MobEntity goalOwnerIn,
java.lang.Class<T> targetClassIn,
int targetChanceIn,
boolean checkSight,
boolean nearbyOnlyIn,
java.util.function.Predicate<LivingEntity> targetPredicate) |
Modifier and Type | Method and Description |
---|---|
protected void |
findNearestTarget() |
protected AxisAlignedBB |
getTargetableArea(double targetDistance) |
boolean |
shouldExecute() |
void |
startExecuting() |
getTargetDistance, isSuitableTarget, resetTask, setUnseenMemoryTicks, shouldContinueExecuting
getMutexFlags, isPreemptible, setMutexFlags, tick, toString
protected final java.lang.Class<T extends LivingEntity> targetClass
protected final int targetChance
protected LivingEntity nearestTarget
protected EntityPredicate targetEntitySelector
public NearestAttackableTargetGoal(MobEntity goalOwnerIn, java.lang.Class<T> targetClassIn, boolean checkSight)
public NearestAttackableTargetGoal(MobEntity goalOwnerIn, java.lang.Class<T> targetClassIn, boolean checkSight, boolean nearbyOnlyIn)
public NearestAttackableTargetGoal(MobEntity goalOwnerIn, java.lang.Class<T> targetClassIn, int targetChanceIn, boolean checkSight, boolean nearbyOnlyIn, @Nullable java.util.function.Predicate<LivingEntity> targetPredicate)
public boolean shouldExecute()
shouldExecute
in class Goal
protected AxisAlignedBB getTargetableArea(double targetDistance)
protected void findNearestTarget()
public void startExecuting()
startExecuting
in class TargetGoal