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

项目:Backmemed    文件:EntityWolf.java   
protected void initEntityAI()
{
    this.aiSit = new EntityAISit(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, new EntityWolf.AIAvoidEntity(this, EntityLlama.class, 24.0F, 1.5D, 1.5D));
    this.tasks.addTask(4, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(5, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(6, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
    this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(9, new EntityAIBeg(this, 8.0F));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(10, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
    this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
        }
    }));
    this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, AbstractSkeleton.class, false));
}
项目:Backmemed    文件:EntityEnderman.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(7, new EntityAIWanderAvoidWater(this, 1.0D, 0.0F));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this));
    this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this));
    this.targetTasks.addTask(1, new EntityEnderman.AIFindPlayer(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>()
    {
        public boolean apply(@Nullable EntityEndermite p_apply_1_)
        {
            return p_apply_1_.isSpawnedByPlayer();
        }
    }));
}
项目:Backmemed    文件:EntityIronGolem.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, false, true, new Predicate<EntityLiving>()
    {
        public boolean apply(@Nullable EntityLiving p_apply_1_)
        {
            return p_apply_1_ != null && IMob.VISIBLE_MOB_SELECTOR.apply(p_apply_1_) && !(p_apply_1_ instanceof EntityCreeper);
        }
    }));
}
项目:CustomWorldGen    文件:EntityWolf.java   
protected void initEntityAI()
{
    this.aiSit = new EntityAISit(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
    this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
    this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(9, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
    this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
        }
    }));
    this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false));
}
项目:CustomWorldGen    文件:EntityEnderman.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this));
    this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this));
    this.targetTasks.addTask(1, new EntityEnderman.AIFindPlayer(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>()
    {
        public boolean apply(@Nullable EntityEndermite p_apply_1_)
        {
            return p_apply_1_.isSpawnedByPlayer();
        }
    }));
}
项目:CustomWorldGen    文件:EntityIronGolem.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, false, true, new Predicate<EntityLiving>()
    {
        public boolean apply(@Nullable EntityLiving p_apply_1_)
        {
            return p_apply_1_ != null && IMob.VISIBLE_MOB_SELECTOR.apply(p_apply_1_) && !(p_apply_1_ instanceof EntityCreeper);
        }
    }));
}
项目:ToroQuest    文件:EntityGuard.java   
protected void initEntityAI() {
    areaAI = new EntityAIMoveIntoArea(this, 0.5D, 30);
    tasks.addTask(0, new EntityAISwimming(this));
    tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, false));
    tasks.addTask(4, areaAI);
    tasks.addTask(7, new EntityAIWander(this, 0.35D));
    tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    tasks.addTask(8, new EntityAILookIdle(this));

    targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this));
    targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 10, false, false, new Predicate<EntityMob>() {
        @Override
        public boolean apply(EntityMob target) {
            return !(target instanceof EntityCreeper);
        }
    }));
}
项目:Gravestone-mod-Extended    文件:EntityDamnedWarrior.java   
public EntityDamnedWarrior(World world) {
        super(world);


//        this.tasks.addTask(2, new EntityAIRestrictSun(this));
//        this.tasks.addTask(5, new EntityAIWander(this, 1));
//        this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 10));
//        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, EntityPlayer.class, true));
//        this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));
//
        if (world != null && !world.isRemote) {
            this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.2D, false));
        }
    }
项目:MobHunter    文件:EntityGendrome.java   
public EntityGendrome(World worldIn) {
    super(worldIn, Config.scaleMin*0.75f, Config.scaleMax*0.75f);
    this.setSize(2.25F, 2.5F);
    setBaseHealth(300);
    setBaseAttack(2*1.5);
    setBaseSpeed(0.3*1.5);
    setBaseKnockback(0.5*1.5);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:MobHunter    文件:EntityJaggia.java   
public EntityJaggia(World worldIn)
{
    super(worldIn, 1, 1, Items.FISH);
    this.setSize(1.5F, 1.8125F);
    setBaseHealth(12);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:MobHunter    文件:EntityGenprey.java   
public EntityGenprey(World worldIn)
{
    super(worldIn, 1, 1);
    this.setSize(1.5F, 1.8125F);
    setBaseHealth(12);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:MobHunter    文件:EntityVelocidrome.java   
public EntityVelocidrome(World worldIn)
{
    super(worldIn, Config.scaleMin*0.75f, Config.scaleMax*0.75f);
    this.setSize(2.25F, 2.5F);
    setBaseHealth(300);
    setBaseAttack(2*1.5);
    setBaseSpeed(0.3*1.5);
    setBaseKnockback(0.5*1.5);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:MobHunter    文件:EntityJaggi.java   
public EntityJaggi(World worldIn)
{
    super(worldIn, 1, 1, Items.FISH);
    this.setSize(1.0F, 1.0F);
    setBaseHealth(9);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:MobHunter    文件:EntityGreatJaggi.java   
public EntityGreatJaggi(World worldIn)
{
    super(worldIn, Config.scaleMin*0.75f, Config.scaleMax*0.75f);
    this.setSize(2.25F, 2.5F);
    setBaseHealth(390);
    setBaseAttack(2*1.5);
    setBaseSpeed(0.3*1.5);
    setBaseKnockback(0.5*1.5);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:MobHunter    文件:EntityVelociprey.java   
public EntityVelociprey(World worldIn)
{
    super(worldIn, 1,1);
    this.setSize(1.5F, 1.8125F);
    setBaseHealth(10);
    setBaseAttack(2);
    setBaseSpeed(0.3);
    setBaseKnockback(0.1);
    this.tasks.addTask(1, new EntityAILeapAtTarget(this,0.5f));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityAnimal.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWitch.class, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMHHerbivore.class, true));
}
项目:LightningCraft    文件:EntityDemonSoldier.java   
/** make the demon */
public EntityDemonSoldier(World world) {
    super(world);

    // reset entity state
    this.isTough = false;

    // chance to be really mean
    if(this.rand.nextDouble() <= 0.01) {
        this.isTough = true;
    }

    // hostile AI
    this.tasks.addTask(0, new EntityAISwimming(this));
       this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
       this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));
       this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
       this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
       this.tasks.addTask(8, new EntityAILookIdle(this));
       this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
       this.setSize(0.6F, 1.8F);

       // hell mob
       this.isImmuneToFire = true;
}
项目:TFC2    文件:EntityElk.java   
public EntityElk(World worldIn) 
{
    super(worldIn);
    this.setSize(1.5F, 1.8F);
    ((PathNavigateGround)this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(0, new EntityAISmartSwim(this));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
    this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));    
    aiHerdMove = new EntityAIHerdMove(this, 0.5D);
    this.tasks.addTask(6, aiHerdMove);
    this.tasks.addTask(7, new EntityAIWanderHex(this, 0.5D));
    //this.tasks.addTask(7, new EntityAIWander(this, 0.5D));
    //this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
    setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
项目:TFC2    文件:EntityElk.java   
public EntityElk(World worldIn) 
{
    super(worldIn);
    this.setSize(1.5F, 1.8F);
    ((PathNavigateGround)this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(0, new EntityAISmartSwim(this));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
    this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));    
    aiHerdMove = new EntityAIHerdMove(this, 0.5D);
    this.tasks.addTask(6, aiHerdMove);
    this.tasks.addTask(7, new EntityAIWanderHex(this, 0.5D));
    //this.tasks.addTask(7, new EntityAIWander(this, 0.5D));
    //this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
    setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
项目:ExpandedRailsMod    文件:EntityWolf.java   
protected void initEntityAI()
{
    this.aiSit = new EntityAISit(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
    this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
    this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(9, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
    this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
        }
    }));
    this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, false));
}
项目:ExpandedRailsMod    文件:EntityEnderman.java   
protected void initEntityAI()
{
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.tasks.addTask(10, new EntityEnderman.AIPlaceBlock(this));
    this.tasks.addTask(11, new EntityEnderman.AITakeBlock(this));
    this.targetTasks.addTask(1, new EntityEnderman.AIFindPlayer(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityEndermite.class, 10, true, false, new Predicate<EntityEndermite>()
    {
        public boolean apply(@Nullable EntityEndermite p_apply_1_)
        {
            return p_apply_1_.isSpawnedByPlayer();
        }
    }));
}
项目:ExpandedRailsMod    文件:EntityIronGolem.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, false, true, new Predicate<EntityLiving>()
    {
        public boolean apply(@Nullable EntityLiving p_apply_1_)
        {
            return p_apply_1_ != null && IMob.VISIBLE_MOB_SELECTOR.apply(p_apply_1_) && !(p_apply_1_ instanceof EntityCreeper);
        }
    }));
}
项目:EnderZoo    文件:EntityEnderminy.java   
public EntityEnderminy(World world) {
  super(world);
  setSize(0.6F * 0.5F, 2.9F * 0.25F);
  stepHeight = 1.0F;

  tasks.addTask(0, new EntityAISwimming(this));
  tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
  tasks.addTask(7, new EntityAIWander(this, 1.0D));
  tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  tasks.addTask(8, new EntityAILookIdle(this));
  targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));

  if(attackIfLookingAtPlayer) {
    targetTasks.addTask(2, new AIFindPlayer());
  }

  if(attackCreepers) {
    targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityCreeper>(this, EntityCreeper.class, true, true));
  }
}
项目:EnderZoo    文件:EntityWitherCat.java   
public EntityWitherCat(World world) {
  super(world);

  followTask = new EntityAIFollowOwner(this, 2.5, 5, 1);
  EntityAIFollowOwner retreatTask = new EntityAIFollowOwner(this, 2.5, 5, 2.5);

  tasks.addTask(1, new EntityAISwimming(this));
  tasks.addTask(2, new EntityAIAttackOnCollideOwned(this, EntityPlayer.class, 2.5, false, retreatTask));
  tasks.addTask(3, followTask);
  tasks.addTask(4, new EntityAIWander(this, 1.0D));
  tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  tasks.addTask(6, new EntityAILookIdle(this));
  tasks.addTask(7, new EntityAIAttackMelee(this, 1.0D, true));

  setSize(DEF_WIDTH, DEF_HEIGHT);
}
项目:harshencastle    文件:EntitySoullessKnight.java   
public EntitySoullessKnight(World worldIn) {
    super(worldIn);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(0, new EntityAIAttackMelee(this, 1d, true));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEnderman.class, 50f, 1d, 2d));
    this.tasks.addTask(0, new AIEntityWanderNoWater(this, 1d, 0));
    this.tasks.addTask(0, new EntityAIMoveTowardsTarget(this, 1d, 100));

    this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
       this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class}));

    this.experienceValue = 50;
}
项目:harshencastle    文件:EntityHarshenSoul.java   
@Override
protected void initEntityAI() {
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(0, new EntityAIAttackMelee(this, 1d, true));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEnderman.class, 10f, 1d, 1.2d));
    this.tasks.addTask(0, new EntityAIWanderAvoidWater(this, 0.35));
    this.tasks.addTask(0, new EntityAIMoveTowardsTarget(this, 0.5d, 100));

    this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:Etheric    文件:EntityLesserCelestial.java   
protected void initEntityAI() {
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 2.0D, true));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.applyEntityAI();
}
项目:Halloween    文件:EntityCreeperween.java   
@Override
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAICreeperween.Swell(this));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
项目:EndermanEvolution    文件:EntityEvolvedEnderman.java   
@Override
protected void initEntityAI() {
    tasks.addTask(0, new EntityAISwimming(this));
    tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    tasks.addTask(7, new EntityAIWander(this, 1.0D));
    tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    tasks.addTask(8, new EntityAILookIdle(this));
    //tasks.addTask(10, new EntityEnderman2.AIPlaceBlock(this));
    //tasks.addTask(11, new EntityEnderman2.AITakeBlock(this));
    targetTasks.addTask(1, new EntityEvolvedEnderman.AIFindPlayer(this));
    targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityEvolvedEndermite>(this, EntityEvolvedEndermite.class, 10, true, false, (@Nullable EntityEvolvedEndermite p_apply_1_) -> p_apply_1_.isSpawnedByPlayer()));
}
项目:EndermanEvolution    文件:EntityFrienderman.java   
@Override
protected void initEntityAI() {
    aiSit = new EntityFrienderman.EntityAISit(this);
    tasks.addTask(0, new EntityAISwimming(this));
    tasks.addTask(1, aiSit);
    tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    tasks.addTask(3, new EntityAIMoveToEntityItem(this, 1.0F, 10.0F));
    tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 5.0F, 10.0F));
    tasks.addTask(5, new EntityAIWander(this, 0.5D));
    tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    tasks.addTask(7, new EntityAILookIdle(this));
    targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    targetTasks.addTask(2, new EntityFrienderman.AIFindPlayer(this));
    targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
}
项目:Backmemed    文件:EntityEndermite.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(3, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:Backmemed    文件:EntityVindicator.java   
protected void initEntityAI()
{
    super.initEntityAI();
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(8, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityVindicator.class}));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityVillager.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));
    this.targetTasks.addTask(4, new EntityVindicator.AIJohnnyAttack(this));
}
项目:Backmemed    文件:EntityCreeper.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAICreeperSwell(this));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
项目:Backmemed    文件:EntitySilverfish.java   
protected void initEntityAI()
{
    this.summonSilverfish = new EntitySilverfish.AISummonSilverfish(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(3, this.summonSilverfish);
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntitySilverfish.AIHideInStone(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:Mods    文件:EntitySaxtonHale.java   
public EntitySaxtonHale(World worldIn) {
    super(worldIn);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.1F, false));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityTF2Character.class, 8.0F));
    this.tasks.addTask(7, new EntityAISeek(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, true));
    this.experienceValue = 1500;
}
项目:Mods    文件:EntityHHH.java   
protected void initEntityAI()
  {
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class,2, false,false,new Predicate<EntityLivingBase>(){

    @Override
    public boolean apply(EntityLivingBase input) {
        // TODO Auto-generated method stub
        return input.getActivePotionEffect(TF2weapons.it)!=null;
    }

      }));
/*this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
      this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class,2, false,false,new Predicate<EntityLivingBase>(){

    @Override
    public boolean apply(EntityLivingBase input) {
        // TODO Auto-generated method stub
        return (input instanceof EntityTF2Character || input instanceof EntityPlayer) && getDistanceSqToEntity(input)<600;
    }

      }));*/

  }
项目:CustomWorldGen    文件:EntityEndermite.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:CustomWorldGen    文件:EntityCreeper.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAICreeperSwell(this));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
项目:CustomWorldGen    文件:EntitySilverfish.java   
protected void initEntityAI()
{
    this.summonSilverfish = new EntitySilverfish.AISummonSilverfish(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(3, this.summonSilverfish);
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntitySilverfish.AIHideInStone(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
项目:ToroChess    文件:EntityChessPiece.java   
@Override
protected void initEntityAI() {
  tasks.addTask(2, new EntityAIAttackMelee(this, 0.5D, true));
  tasks.addTask(4, new EntityAIMoveToPosition(this));
  tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 3.0F));
  tasks.addTask(6, new EntityAILookDownBoard(this));
}
项目:ToroQuest    文件:EntityVampireBat.java   
protected void initEntityAI() {
    tasks.addTask(2, new EntityAIAttackMelee(this, 0.4D, false));
    targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityToroNpc.class, true));
    targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, EntityAnimal.class, false));
}