本文整理匯總了Java中net.minecraft.entity.ai.EntityAIAvoidEntity類的典型用法代碼示例。如果您正苦於以下問題:Java EntityAIAvoidEntity類的具體用法?Java EntityAIAvoidEntity怎麽用?Java EntityAIAvoidEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityAIAvoidEntity類屬於net.minecraft.entity.ai包,在下文中一共展示了EntityAIAvoidEntity類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: EntityVillager
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityVillager(World worldIn, int professionId)
{
super(worldIn);
this.villagerInventory = new InventoryBasic("Items", false, 8);
this.setProfession(professionId);
this.setSize(0.6F, 1.8F);
((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIVillagerInteract(this));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.setCanPickUpLoot(true);
}
示例2: EntitySkeleton
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntitySkeleton(World worldIn)
{
super(worldIn);
this.tasks.addTask(1, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIRestrictSun(this));
this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D));
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, 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 (worldIn != null && !worldIn.isRemote)
{
this.setCombatTask();
}
}
示例3: EntityRabbit
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的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);
}
示例4: initEntityAI
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEvoker.class, 12.0F, 0.8D, 0.8D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityVindicator.class, 8.0F, 0.8D, 0.8D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityVex.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIVillagerInteract(this));
this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例5: initEntityAI
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
protected void initEntityAI()
{
super.initEntityAI();
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityEvoker.AICastingSpell());
this.tasks.addTask(2, new EntityAIAvoidEntity(this, EntityPlayer.class, 8.0F, 0.6D, 1.0D));
this.tasks.addTask(4, new EntityEvoker.AISummonSpell());
this.tasks.addTask(5, new EntityEvoker.AIAttackSpell());
this.tasks.addTask(6, new EntityEvoker.AIWololoSpell());
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[] {EntityEvoker.class}));
this.targetTasks.addTask(2, (new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)).func_190882_b(300));
this.targetTasks.addTask(3, (new EntityAINearestAttackableTarget(this, EntityVillager.class, false)).func_190882_b(300));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, false));
}
示例6: EntitySpy
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntitySpy(World p_i1738_1_) {
super(p_i1738_1_);
this.experienceValue = 15;
this.rotation = 20;
this.tasks.addTask(2, new EntityAIAvoidEntity<EntityLivingBase>(this, EntityLivingBase.class, entity -> {
return entity == this.getAttackTarget() && TF2Util.lookingAtFast(entity, 105, this.posX, this.posY, this.posZ);
}, 4, 1.0f, 1.0f));
this.tasks.addTask(3, new EntityAIAmbush(this));
this.tasks.removeTask(avoidSentry);
if (this.attack != null) {
attack.setRange(30f);
this.tasks.addTask(4, this.attack);
}
this.getCapability(TF2weapons.WEAPONS_CAP, null).invisTicks = 20;
if(!this.world.isRemote) {
this.getWepCapability().setInvisible(true);
this.getWepCapability().setDisguised(true);
this.getWepCapability().setDisguiseType("T:Engineer");
}
}
示例7: initEntityAI
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIVillagerInteract(this));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例8: EntitySlave
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的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();
}
示例9: EntityStymph
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的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));
}
示例10: EntityVillager
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityVillager(World par1World, int par2)
{
super(par1World);
this.setProfession(par2);
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(8, new EntityAIPlay(this, 0.32D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例11: EntityOcelot
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityOcelot(World par1World)
{
super(par1World);
this.setSize(0.6F, 0.8F);
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(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
this.tasks.addTask(6, new EntityAIOcelotSit(this, 1.33D));
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, 750, false));
}
示例12: EntityGreenVillager
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityGreenVillager(World worldIn, int professionId)
{
super(worldIn);
this.villagerInventory = new InventoryBasic("Items", false, 8);
this.setProfession(professionId);
this.setSize(0.6F, 1.8F);
((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradeGreen(this));
this.tasks.addTask(1, new EntityAILookAtTradeGreen(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.setCanPickUpLoot(true);
}
示例13: EntityRana
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityRana(World par1World, int par2)
{
super(par1World);
randomTickDivider = 0;
isPlayingFlag = false;
villageObj = null;
setProfession(par2);
dead = false;
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntitySkeleton.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntitySpider.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityTNTPrimed.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityCreeper.class, 8.0F, 0.6D, 0.6D));
tasks.addTask(5, new EntityAIMoveIndoors(this));
tasks.addTask(6, new EntityAIRestrictOpenDoor(this));
tasks.addTask(7, new EntityAIOpenDoor(this, true));
tasks.addTask(8, new EntityAIMoveTowardsRestriction(this, 0.3F));
tasks.addTask(9, new EntityAIWatchClosest2(this, net.minecraft.entity.player.EntityPlayer.class, 3F, 1.0F));
tasks.addTask(10, new EntityAIWatchClosest2(this, net.minecraft.entity.passive.EntityVillager.class, 5F, 0.02F));
tasks.addTask(11, new EntityAIWatchClosest2(this, com.stormister.rediscovered.EntityRana.class, 5F, 0.02F));
tasks.addTask(12, new EntityAIWatchClosest2(this, com.stormister.rediscovered.EntitySteve.class, 5F, 0.02F));
tasks.addTask(13, new EntityAIWander(this, 0.3F));
tasks.addTask(14, new EntityAIWatchClosest(this, net.minecraft.entity.EntityLiving.class, 8F));
}
示例14: EntityPigman
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityPigman(World worldIn, int professionId)
{
super(worldIn);
this.villagerInventory = new InventoryBasic("Items", false, 8);
this.setProfession(professionId);
this.setSize(0.6F, 1.8F);
((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePigman(this));
this.tasks.addTask(1, new EntityAILookAtTradePigman(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIPigmanMate(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.setCanPickUpLoot(true);
}
示例15: EntityMagician
import net.minecraft.entity.ai.EntityAIAvoidEntity; //導入依賴的package包/類
public EntityMagician(World world) {
super(world);
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(8, new EntityAIPlay(this, 0.32D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}