本文整理匯總了Java中net.minecraft.entity.ai.EntityAIMate類的典型用法代碼示例。如果您正苦於以下問題:Java EntityAIMate類的具體用法?Java EntityAIMate怎麽用?Java EntityAIMate使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityAIMate類屬於net.minecraft.entity.ai包,在下文中一共展示了EntityAIMate類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: EntityRabbit
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntityRabbit(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 0.7F);
this.jumpHelper = new EntityRabbit.RabbitJumpHelper(this);
this.moveHelper = new EntityRabbit.RabbitMoveHelper(this);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.navigator.setHeightRequirement(2.5F);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityRabbit.AIPanic(this, 1.33D));
this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.carrot, false));
this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.golden_carrot, false));
this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Item.getItemFromBlock(Blocks.yellow_flower), false));
this.tasks.addTask(3, new EntityAIMate(this, 0.8D));
this.tasks.addTask(5, new EntityRabbit.AIRaidFarm(this));
this.tasks.addTask(5, new EntityAIWander(this, 0.6D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.aiAvoidWolves = new EntityRabbit.AIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D);
this.tasks.addTask(4, this.aiAvoidWolves);
this.setMovementSpeed(0.0D);
}
示例2: EntityHorse
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntityHorse(World worldIn)
{
super(worldIn);
this.setSize(1.4F, 1.6F);
this.isImmuneToFire = false;
this.setChested(false);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.2D));
this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D));
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.0D));
this.tasks.addTask(6, new EntityAIWander(this, 0.7D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
this.initHorseChest();
}
示例3: EntitySheep
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntitySheep(World worldIn)
{
super(worldIn);
this.setSize(0.9F, 1.3F);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(5, this.entityAIEatGrass);
this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
this.inventoryCrafting.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0));
this.inventoryCrafting.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0));
}
示例4: EntityPig
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntityPig(World worldIn)
{
super(worldIn);
this.setSize(0.9F, 0.9F);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F));
this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false));
this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false));
this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
}
示例5: EntityOcelot
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntityOcelot(World worldIn)
{
super(worldIn);
this.setSize(0.6F, 0.7F);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
示例6: EntityRabbit
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
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);
}
示例7: initEntityAI
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
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));
}
示例8: initEntityAI
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
protected void initEntityAI()
{
this.aiSit = new EntityAISit(this);
this.aiTempt = new EntityAITempt(this, 0.6D, Items.FISH, true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt);
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWanderAvoidWater(this, 0.8D, 1.0000001E-5F));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
示例9: initEntityAI
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
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));
}
示例10: initEntityAI
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
protected void initEntityAI()
{
this.aiSit = new EntityAISit(this);
this.aiTempt = new EntityAITempt(this, 0.6D, Items.FISH, true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt);
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
示例11: EntitySlave
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntitySlave(World p_i1688_1_)
{
super(p_i1688_1_);
this.setSize(0.8F, 1.6F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.diamond, true));
this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(5, new EntityAIAvoidEntity(this, EntityCreeper.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(6, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(7, new EntityAIOcelotAttack(this));
this.tasks.addTask(8, new EntityAIMate(this, 0.8D));
this.tasks.addTask(9, new EntityAIWander(this, 0.8D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityMob.class, 750, false));
this.setType(this.rand.nextInt(4));
this.setRandomStuff();
}
示例12: EntityStymph
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntityStymph(World w)
{
super(w);
this.setSize(0.6F, 1.4F);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, this.aiSit);
this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, ItemRegister.BERRY_RED, true));
this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityCow.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
this.tasks.addTask(8, new EntityAIOcelotAttack(this));
this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntitySnowCube.class, 750, false));
this.setTameSkin(this.worldObj.rand.nextInt(3));
}
示例13: Elk
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public Elk(World worldIn)
{
super(worldIn);
this.setSize(1.8F, 2.5F);
((PathNavigateGround) this.getNavigator()).func_179690_a(true);
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, Item.getItemFromBlock(Blocks.grass), false));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIEatGrass(this));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
}
示例14: ElkBaby
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public ElkBaby(World worldIn)
{
super(worldIn);
this.setSize(1.8F, 2.5F);
((PathNavigateGround) this.getNavigator()).func_179690_a(true);
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, Item.getItemFromBlock(Blocks.grass), false));
this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
this.tasks.addTask(5, new EntityAIEatGrass(this));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
}
示例15: EntityDodo
import net.minecraft.entity.ai.EntityAIMate; //導入依賴的package包/類
public EntityDodo(World worldIn)
{
super(worldIn);
this.setSize(0.4F, 0.7F);
this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000;
this.invDodo = new InventoryDino("Items", true, 9);
this.tasks.taskEntries.clear();
int p = 0;
this.tasks.addTask(++p, new EntityAISwimming(this));
this.tasks.addTask(++p, this.aiSit);
this.tasks.addTask(++p, new EntityAIPanic(this, 1.4D));
this.tasks.addTask(++p, new EntityAIMate(this, 1.0D));
this.tasks.addTask(++p, new EntityAITempt(this, 1.0D, ARKCraftItems.narcoBerry, false));
this.tasks.addTask(++p, new EntityAIFollowParent(this, 1.1D));
this.tasks.addTask(++p, new EntityAIWander(this, 1.0D));
this.tasks.addTask(++p, new EntityAIFollowOwner(this, 1.0D, 8.0F, 5.0F));
this.tasks.addTask(++p, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
// Replace Idle task with one that blinks eyes
this.tasks.addTask(++p, new EntityDodoAILookIdle(this));
// this.riddenByEntity = null;
}