net.minecraft.entity.ai.EntityAIFollowParent Java Examples

The following examples show how to use net.minecraft.entity.ai.EntityAIFollowParent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityElk.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #2
Source File: EntityPenguin.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected void initEntityAI() {
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(0,
			new EntityAIAvoidEntity<EntityPolarBear>(this, EntityPolarBear.class, 16, 0.5D, 1.5D));
	this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
	this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
	this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.FISH, false));
	this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
	this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
	this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
	this.tasks.addTask(6, new EntityAIMate(this, 0.5D));
	this.tasks.addTask(7, new EntityAILookIdle(this));
}
 
Example #3
Source File: EntityExplodingChicken.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected void initEntityAI()
   {
       this.tasks.addTask(0, new EntityAISwimming(this));
       this.tasks.addTask(1, new EntityAIPanic(this, 1.4D));
       this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
       this.tasks.addTask(3, new EntityAITemptAndExplode(this, 1.0D, false, TEMPTATION_ITEMS));
       this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
       this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
       this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
       this.tasks.addTask(7, new EntityAILookIdle(this));
   }
 
Example #4
Source File: EntityMoby.java    From mobycraft with Apache License 2.0 5 votes vote down vote up
public EntityMoby(World worldIn)
{
    super(worldIn);
    this.setSize(1.8F, 1.3F);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(false);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
    this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.fish, false));
    this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
    this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
}
 
Example #5
Source File: EntityOwl.java    From EnderZoo with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
public EntityOwl(World worldIn) {
  super(worldIn);
  setSize(0.4F, 0.85F);
  stepHeight = 1.0F;

  
  int pri = 0;
  tasks.addTask(++pri, new EntityAIFlyingPanic(this, 2));
  tasks.addTask(++pri, new EntityAIFlyingAttackOnCollide(this, 2.5, false));    
  tasks.addTask(++pri, new EntityAIMate(this, 1.0));
  tasks.addTask(++pri, new EntityAITempt(this, 1.0D, Items.SPIDER_EYE, false));
  tasks.addTask(++pri, new EntityAIFollowParent(this, 1.5));
  tasks.addTask(++pri, new EntityAIFlyingLand(this, 2));
  tasks.addTask(++pri, new EntityAIFlyingFindPerch(this, 2, 80));
  tasks.addTask(++pri, new EntityAIFlyingShortWander(this, 2, 150));

  tasks.addTask(++pri, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
  tasks.addTask(++pri, new EntityAILookIdle(this));

  EntityAINearestAttackableTargetBounded<EntitySpider> targetSpiders = new EntityAINearestAttackableTargetBounded<EntitySpider>(this, EntitySpider.class,
      true, true);
  targetSpiders.setMaxDistanceToTarget(12);
  targetSpiders.setMaxVerticalDistanceToTarget(24);
  targetTasks.addTask(0, targetSpiders);

  moveHelper = new FlyingMoveHelper(this);

  timeUntilNextEgg = getNextLayingTime();
}