use of net.minecraft.entity.ai.EntityAIAttackRanged in project SpongeCommon by SpongePowered.
the class SpongeRangeAgentAIBuilder method build.
@Override
public RangeAgentAITask build(Ranger owner) {
checkNotNull(owner);
checkArgument(owner instanceof IRangedAttackMob, "Ranger must be an IRangedAttackMob!");
return (RangeAgentAITask) new EntityAIAttackRanged((IRangedAttackMob) owner, this.maxSpeed, this.delayBetweenAttacks, this.attackRadius);
}
use of net.minecraft.entity.ai.EntityAIAttackRanged in project Tropicraft by Tropicraft.
the class EntityTreeFrog method initEntityAI.
@Override
protected void initEntityAI() {
super.initEntityAI();
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F));
this.tasks.addTask(2, new EntityAIWander(this, 1.0D));
hostileAI = new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true);
this.targetTasks.addTask(1, hostileAI);
}
use of net.minecraft.entity.ai.EntityAIAttackRanged in project Minestuck by mraof.
the class EntityPawn method setCombatTask.
// /**
// * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack.
// */
// @Override
// protected void attackEntity(Entity par1Entity, float par2)
// {
// if (this.attackTime <= 0 && par2 < 2.0F && par1Entity.getEntityBoundingBox().maxY > this.getEntityBoundingBox().minY && par1Entity.getEntityBoundingBox().minY < this.getEntityBoundingBox().maxY)
// {
// this.attackTime = 20;
// this.attackEntityAsMob(par1Entity);
// }
// }
@Override
public void setCombatTask() {
if (this.entityAIArrowAttack == null || this.entityAIAttackOnCollide == null) {
entityAIArrowAttack = new EntityAIAttackRanged(this, 0.25F, 20, 10.0F);
entityAIAttackOnCollide = new EntityAIAttackMelee(this, .4F, false);
}
this.tasks.removeTask(this.entityAIArrowAttack);
this.tasks.removeTask(this.entityAIAttackOnCollide);
ItemStack weapon = this.getHeldItemMainhand();
if (weapon != null && weapon.getItem() == Items.BOW) {
this.tasks.addTask(4, this.entityAIArrowAttack);
} else
this.tasks.addTask(4, this.entityAIAttackOnCollide);
}
use of net.minecraft.entity.ai.EntityAIAttackRanged in project takumicraft by TNTModders.
the class EntitySnowCreeper method initEntityAI.
@Override
protected void initEntityAI() {
super.initEntityAI();
this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, 10, true, false, IMob.MOB_SELECTOR));
}
Aggregations