net.minecraft.entity.ai.EntityAIMate Java Examples

The following examples show how to use net.minecraft.entity.ai.EntityAIMate. 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: EntityRabbit.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
public EntityRabbit(World world) {
	super(world);
	moveType = EntityRabbit.EnumMoveType.HOP;
	carrotTicks = 0;
	setSize(0.4F, 0.5F);
	ReflectionHelper.setPrivateValue(EntityLiving.class, this, new EntityRabbit.RabbitJumpHelper(this), "jumpHelper", "field_70767_i");
	ReflectionHelper.setPrivateValue(EntityLiving.class, this, new EntityRabbit.RabbitMoveHelper(), "moveHelper", "field_70765_h");
	getNavigator().setAvoidsWater(true);
	//		navigator.func_179678_a(2.5F);
	tasks.addTask(1, new EntityAISwimming(this));
	tasks.addTask(1, new EntityRabbit.AIPanic(1.33D));
	tasks.addTask(2, new EntityAIMate(this, 0.8D));
	tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.carrot, false));
	tasks.addTask(5, new EntityRabbit.AIRaidFarm());
	tasks.addTask(5, new EntityAIWander(this, 0.6D));
	tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
	tasks.addTask(4, new EntityAIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D));
	tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
	setMovementSpeed(0.0D);
}
 
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: EntityDabSquirrel.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected void initEntityAI() {
	this.tasks.addTask(1, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIPanic(this, 0.72D));
	this.tasks.addTask(3, new EntityAIMate(this, 0.5D));
	this.tasks.addTask(4, new EntityAITempt(this, 0.5D, Items.WHEAT_SEEDS, false));
	this.tasks.addTask(5, new EntityAIAvoidEntity<EntityPlayer>(this, EntityPlayer.class, 10F, 0.5D, 0.7D));
	this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.5D));
}
 
Example #5
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 #6
Source File: EntityEasterCow.java    From Moo-Fluids with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void initEntityAI() {
  tasks.addTask(0, new EntityAISwimming(this));
  tasks.addTask(1, new EntityAIPanic(this, 2.0D));
  tasks.addTask(2, new EntityAIMate(this, 1.0D));
  tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.GOLDEN_CARROT, false));
  tasks.addTask(4, new EntityAIAvoidEntity<EntityPlayer>
      (this, EntityPlayer.class, 8.0F, 2.2D, 2.2D));
  tasks.addTask(4, new EntityAIAvoidEntity<EntityWolf>
      (this, EntityWolf.class, 10.0F, 2.2D, 2.2D));
  tasks.addTask(6, new EntityAIWander(this, 0.6D));
  tasks.addTask(7, new EntityAILookIdle(this));
  tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
}
 
Example #7
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();
}