Java 类net.minecraft.entity.ai.EntityAIAttackRanged 实例源码

项目:UHC-Reloaded    文件:EasierSkeleton.java   
@SubscribeEvent
public void onSkeletonUpdate(LivingEvent.LivingUpdateEvent event) {
    if (!(event.getEntityLiving() instanceof EntitySkeleton)) {
        return;
    }
    EntitySkeleton skeleton = (EntitySkeleton) event.getEntityLiving();
    EntityAITasks tasks = skeleton.tasks;
    boolean containsOld = false;
    Iterator<EntityAITasks.EntityAITaskEntry> itr = tasks.taskEntries.iterator();
    while (itr.hasNext()) {
        EntityAITasks.EntityAITaskEntry entry = itr.next();
        if (entry.action instanceof EntityAIAttackRangedBow) {
            itr.remove();
        }
        if (entry.action instanceof EntityAIAttackRanged) {
            containsOld = true;
        }
    }
    if (!containsOld) {
        tasks.addTask(4, new EntityAIAttackRanged(skeleton, 1.0D, 20, 15.0F));
    }
}
项目:Halloween    文件:EntityHallowitch.java   
@Override
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F));
    this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(3, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHallowitch.HurtByAggressor(this)); // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAIHallowitch.TargetAggressor(this)); // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:Backmemed    文件:EntityLlama.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D));
    this.tasks.addTask(2, new EntityAILlamaFollowCaravan(this, 2.0999999046325684D));
    this.tasks.addTask(3, new EntityAIAttackRanged(this, 1.25D, 40, 20.0F));
    this.tasks.addTask(3, new EntityAIPanic(this, 1.2D));
    this.tasks.addTask(4, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(5, new EntityAIFollowParent(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.7D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityLlama.AIHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityLlama.AIDefendTarget(this));
}
项目:Backmemed    文件:EntitySnowman.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
    this.tasks.addTask(2, new EntityAIWanderAvoidWater(this, 1.0D, 1.0000001E-5F));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(4, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.MOB_SELECTOR));
}
项目:Backmemed    文件:EntityWitch.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F));
    this.tasks.addTask(2, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(3, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:Backmemed    文件:EntityWither.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityWither.AIDoNothing());
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD));
}
项目:CustomWorldGen    文件:EntitySnowman.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
    this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(4, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.MOB_SELECTOR));
}
项目:CustomWorldGen    文件:EntityWitch.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F));
    this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(3, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:CustomWorldGen    文件:EntityWither.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityWither.AIDoNothing());
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F));
    this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD));
}
项目:ToroQuest    文件:EntityMage.java   
protected void ai() {
    tasks.addTask(1, new EntityAISwimming(this));
    tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 16, 10.0F));
    tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    tasks.addTask(3, new EntityAILookIdle(this));
    targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:ExpandedRailsMod    文件:EntitySnowman.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
    this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(4, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.MOB_SELECTOR));
}
项目:ExpandedRailsMod    文件:EntityWitch.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F));
    this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(3, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:ExpandedRailsMod    文件:EntityWither.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityWither.AIDoNothing());
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F));
    this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD));
}
项目:AbyssalCraft    文件:EntityCoraliumSquid.java   
@Override
protected void initEntityAI()
{
    super.initEntityAI();
    tasks.addTask(1, new EntityAIAttackRanged(this, 0.6D, 80, 8.0F));
}