net.minecraft.entity.ai.EntityAIWander Java Examples
The following examples show how to use
net.minecraft.entity.ai.EntityAIWander.
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: EntityWitherCat.java From EnderZoo with Creative Commons Zero v1.0 Universal | 6 votes |
public EntityWitherCat(World world) { super(world); followTask = new EntityAIFollowOwner(this, 2.5, 5, 1); EntityAIFollowOwner retreatTask = new EntityAIFollowOwner(this, 2.5, 5, 2.5); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackOnCollideOwned(this, EntityPlayer.class, 2.5, false, retreatTask)); tasks.addTask(3, followTask); tasks.addTask(4, new EntityAIWander(this, 1.0D)); tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(6, new EntityAILookIdle(this)); tasks.addTask(7, new EntityAIAttackMelee(this, 1.0D, true)); setSize(DEF_WIDTH, DEF_HEIGHT); }
Example #2
Source File: EntityGuard.java From ToroQuest with GNU General Public License v3.0 | 6 votes |
protected void initEntityAI() { areaAI = new EntityAIMoveIntoArea(this, 0.5D, 30); tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, false)); tasks.addTask(4, areaAI); tasks.addTask(7, new EntityAIWander(this, 0.35D)); tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(8, new EntityAILookIdle(this)); targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this)); targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 10, false, false, new Predicate<EntityMob>() { @Override public boolean apply(EntityMob target) { return !(target instanceof EntityCreeper); } })); }
Example #3
Source File: EntityDireWolf.java From EnderZoo with Creative Commons Zero v1.0 Universal | 6 votes |
public EntityDireWolf(World world) { super(world); setSize(0.8F, 1.2F); //getNavigator().setAvoidsWater(true); // ((PathNavigateGround) this.getNavigator()).setAvoidsWater(true); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); tasks.addTask(4, new EntityAIAttackOnCollideAggressive(this, 1.1D, true).setAttackFrequency(20)); tasks.addTask(7, new EntityAIWander(this, 0.5D)); tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(9, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); if(Config.direWolfAggresiveRange > 0) { EntityAINearestAttackableTargetBounded<EntityPlayer> nearTarg = new EntityAINearestAttackableTargetBounded<EntityPlayer>(this, EntityPlayer.class, true); nearTarg.setMaxDistanceToTarget(Config.direWolfAggresiveRange); targetTasks.addTask(2, nearTarg); } }
Example #4
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 #5
Source File: EntityEnderminy.java From EnderZoo with Creative Commons Zero v1.0 Universal | 6 votes |
public EntityEnderminy(World world) { super(world); setSize(0.6F * 0.5F, 2.9F * 0.25F); stepHeight = 1.0F; tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false)); tasks.addTask(7, new EntityAIWander(this, 1.0D)); tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(8, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); if(attackIfLookingAtPlayer) { targetTasks.addTask(2, new AIFindPlayer()); } if(attackCreepers) { targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityCreeper>(this, EntityCreeper.class, true, true)); } }
Example #6
Source File: EntityEndermanFighter.java From enderutilities with GNU Lesser General Public License v3.0 | 5 votes |
@Override protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.tasks.addTask(6, new EntityEndermanFighter.AIDespawn(this, 200)); this.targetTasks.addTask(1, new EntityEndermanFighter.AIAttackAssignedTarget(this, true)); this.targetTasks.addTask(2, new EntityEndermanFighter.AIAttackRevengeTarget(this, false)); this.targetTasks.addTask(3, new EntityEndermanFighter.AIAttackClosestPlayer(this, false)); }
Example #7
Source File: EntityClayGolem.java From Artifacts with MIT License | 5 votes |
public EntityClayGolem(World par1World) { super(par1World); //this.moveSpeed = 0.16F; /*this.setSize(1.4F, 2.9F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 0.288D, false)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityZombie.class, 0.288D, true)); this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 0.16D)); this.tasks.addTask(4, new EntityAIWander(this, 0.16D)); this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityZombie.class, 0, true)); //this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, true, IMob.mobSelector)); //this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityZombie.class, 0, false, true, IMob.mobSelector));*/ this.getNavigator().setAvoidsWater(true); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(3, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1.0D, false)); this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false)); }
Example #8
Source File: EntityWitherWitch.java From EnderZoo with Creative Commons Zero v1.0 Universal | 5 votes |
public EntityWitherWitch(World world) { super(world); rangedAttackAI = new EntityAIRangedAttack(this, 1, 60, 10); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, rangedAttackAI); tasks.addTask(2, new EntityAIWander(this, 1.0D)); tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(3, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true)); }
Example #9
Source File: EntityFallenMount.java From EnderZoo with Creative Commons Zero v1.0 Universal | 5 votes |
public EntityFallenMount(World world) { super(world); setGrowingAge(0); setHorseSaddled(true); tasks.taskEntries.clear(); tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(6, new EntityAIWander(this, 1.2D)); tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); tasks.addTask(8, new EntityAILookIdle(this)); findTargetAI = new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true); attackAI = new EntityAIAttackMelee(this, MOUNTED_ATTACK_MOVE_SPEED, false); updateAttackAI(); }
Example #10
Source File: EntityArcher.java From Electro-Magic-Tools with GNU General Public License v3.0 | 5 votes |
public EntityArcher(World par1World) { super(par1World); this.isImmuneToFire = true; this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); this.tasks.addTask(4, new EntityAIWander(this, 0.30D)); }
Example #11
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 #12
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 #13
Source File: EntityEndermite.java From Et-Futurum with The Unlicense | 5 votes |
public EntityEndermite(World world) { super(world); sorter = new EntityAINearestAttackableTarget.Sorter(this); experienceValue = 3; setSize(0.4F, 0.3F); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); tasks.addTask(3, new EntityAIWander(this, 1.0D)); tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(8, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 10, true)); }
Example #14
Source File: EntityToro.java From ToroQuest with GNU General Public License v3.0 | 5 votes |
protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.75, false)); 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 #15
Source File: EntitySentry.java From ToroQuest with GNU General Public License v3.0 | 5 votes |
protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 0.5D, false)); tasks.addTask(7, new EntityAIWander(this, 0.35D)); tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(8, new EntityAILookIdle(this)); targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this)); targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 2, false, false, new Predicate<EntityMob>() { @Override public boolean apply(EntityMob target) { return !(target instanceof EntityCreeper); } })); }
Example #16
Source File: EntityMoby.java From mobycraft with Apache License 2.0 | 5 votes |
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 #17
Source File: EntityHamster.java From Hyperium with GNU Lesser General Public License v3.0 | 5 votes |
public EntityHamster(World worldIn) { super(worldIn); setSize(0.4F, 0.2F); ((PathNavigateGround) getNavigator()).setAvoidsWater(true); tasks.addTask(1, new EntityAIFollowOwner(this, 1f, 10f, 2f)); tasks.addTask(2, new EntityAIWander(this, 1)); tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayerSP.class, 8f)); tasks.addTask(3, new EntityAILookIdle(this)); setTamed(true); preventEntitySpawning = false; }
Example #18
Source File: TransIconHerobrineButWithBetterPantsEntity.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(1, new EntityAIWander(this, 0.6)); this.tasks.addTask(2, new EntityAIAttackRanged(this, 0.6, 20, 6.0F)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 32.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, NotchButWithWorsererPantsEntity.class, false)); }