net.minecraft.entity.ai.EntityAIAvoidEntity Java Examples
The following examples show how to use
net.minecraft.entity.ai.EntityAIAvoidEntity.
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: EntityFairy.java From Wizardry with GNU Lesser General Public License v3.0 | 6 votes |
@Override protected void setupTamedAI() { FairyData dataFairy = getDataFairy(); if (dataFairy != null && dataFairy.isDepressed) return; if (this.avoidEntity == null) { this.avoidEntity = new EntityAIAvoidEntity<>(this, EntityPlayer.class, 16.0F, 2, 3); } this.tasks.removeTask(this.avoidEntity); if (!this.isTamed()) { this.tasks.addTask(0, this.avoidEntity); } this.tasks.addTask(0, new EntityAIAvoidEntity<>(this, EntityUnicorn.class, 16, 2, 3)); this.tasks.addTask(0, new EntityAIAvoidEntity<>(this, EntitySpiritWight.class, 16, 2, 3)); }
Example #2
Source File: EntityRabbit.java From Et-Futurum with The Unlicense | 6 votes |
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 #3
Source File: EntityPenguin.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
@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 #4
Source File: EntityDabSquirrel.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
@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: EntityEasterCow.java From Moo-Fluids with GNU General Public License v3.0 | 5 votes |
@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 #6
Source File: EntityFugitive.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(2, new EntityAIAvoidEntity(this, EntityPlayer.class, 8.0F, 1, 0.5)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityPlayer.class, PLAYER_WITH_LEAD, 60.0F, 1.5D, 1D)); }