@Override protected void initEntityAI() { this.tasks.addTask(0, new EntityAIWander(this, 0.6D)); }
public boolean shouldExecute() { return this.entity.onGround && super.shouldExecute(); } }
/** * Returns whether an in-progress EntityAIBase should continue executing */ public boolean shouldContinueExecuting() { return this.field_179484_c ? false : super.shouldContinueExecuting(); }
/** * Execute a one shot task or start executing a continuous task */ public void startExecuting() { if (!this.field_179484_c) { super.startExecuting(); } else { BlockPos blockpos = (new BlockPos(Netherfish.this.posX, Netherfish.this.posY + 0.5D, Netherfish.this.posZ)).offset(this.field_179483_b); int meta = NetherfishSpawn.getInstance().getMetadataFromBlock(Netherfish.this.world.getBlockState(blockpos).getBlock()); if (meta >= 0) { Netherfish.this.world.setBlockState(blockpos, NetherfishSpawn.getInstance().getDefaultState().withProperty(NetherfishSpawn.FAKEMETA, meta)); Netherfish.this.spawnExplosionParticle(); Netherfish.this.setDead(); } } }
@Override public void startExecuting() { if(!doMerge) super.startExecuting(); else { World world = endermite.getEntityWorld(); BlockPos blockpos = (new BlockPos(endermite.posX, endermite.posY + 0.5D, endermite.posZ)).offset(facing); IBlockState iblockstate = world.getBlockState(blockpos); if(iblockstate.getBlock() == Blocks.PURPUR_BLOCK) { world.setBlockToAir(blockpos); endermite.spawnExplosionParticle(); endermite.setDead(); EntityShulker shulker = new EntityShulker(world); shulker.setAttachmentPos(blockpos); shulker.setPosition(blockpos.getX() + 0.5, blockpos.getY() + 0.5, blockpos.getZ() + 0.5); world.spawnEntity(shulker); } } }
public EntityBotFlyLarva(World world) { super(world); setSize(0.5F, 0.2F); isImmuneToFire = true; tasks.addTask(0, new EntityAIWander(this, 0.3D)); }
@Override public boolean shouldExecute() { return !antlion.isInsideOfMaterial(Material.SAND) && super.shouldExecute(); }
@Override public boolean shouldContinueExecuting() { return doMerge ? false : super.shouldContinueExecuting(); }
@Override protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(6, new EntityAIAttackMelee(this, 1.0, false)); this.tasks.addTask(15, new EntityAIWander(this, 0.7)); this.tasks.addTask(16, new EntityAIWatchClosest(this, EntityPlayer.class, 10)); this.targetTasks.addTask(8, new MinionAIHurtByTarget(this, false)); } }
public boolean shouldExecute(){ return !worm.isInSand() && super.shouldExecute(); }
public boolean shouldContinueExecuting(){ return !worm.isInSand() && super.shouldContinueExecuting(); } }
@Override protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); 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, true)); }
public boolean shouldExecute(){ return !this.entity.isInWater() && !((EntitySiren)entity).isSinging() && super.shouldExecute(); }
public boolean shouldContinueExecuting(){ return !(entity instanceof EntityTameable && ((EntityTameable) entity).isSitting()) && !this.entity.isInWater() && super.shouldContinueExecuting(); } }
@Override protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); 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)); }
public boolean shouldExecute(){ return !(entity instanceof EntityTameable && ((EntityTameable) entity).isSitting()) && !this.entity.isInWater() && super.shouldExecute(); }
public boolean shouldContinueExecuting(){ return !this.entity.isInWater() && !((EntitySiren)entity).isSinging() && super.shouldContinueExecuting(); } }
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, ZooConfig.fallenMountChargeSpeed.get(), false); updateAttackAI(); }
/** * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { if (Netherfish.this.getAttackTarget() != null) { return false; } else if (!Netherfish.this.getNavigator().noPath()) { return false; } else { Random random = Netherfish.this.getRNG(); if (Configs.isEnabled(NetherfishSpawnConfig.class) && random.nextInt(10) == 0) { this.field_179483_b = EnumFacing.random(random); BlockPos blockpos = (new BlockPos(Netherfish.this.posX, Netherfish.this.posY + 0.5D, Netherfish.this.posZ)).offset(this.field_179483_b); int meta = NetherfishSpawn.getInstance().getMetadataFromBlock(Netherfish.this.world.getBlockState(blockpos).getBlock()); if (meta >= 0) { this.field_179484_c = true; return true; } } this.field_179484_c = false; return super.shouldExecute(); } }
@Override protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); 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)); }