Package net.minecraft.entity

Examples of net.minecraft.entity.EntityLiving


    List<IMob> mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
    if(mobs.size() > 1 && mana >= cost)
      for(IMob mob : mobs) {
        if(mob instanceof EntityLiving) {
          EntityLiving entity = (EntityLiving) mob;
          if(brainwashEntity(entity, mobs)) {
            mana -= cost;
            sync();
            break;
          }
View Full Code Here


          }

          double d2 = logic.getSpawnerX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
          double d3 = logic.getSpawnerY() + logic.getSpawnerWorld().rand.nextInt(3) - 1;
          double d4 = logic.getSpawnerZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
          EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
          entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);

          if(entityliving == null || entityliving.getCanSpawnHere()) {
            logic.func_98265_a(entity);
            logic.getSpawnerWorld().playAuxSFX(2004, logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), 0);

            if (entityliving != null)
              entityliving.spawnExplosionParticle();

            flag = true;
          }
        }

View Full Code Here

            setInvulTime(invul + 1);
          }

          if(reverseTicks > MOB_SPAWN_START_TICKS * 2 && mobTicks > MOB_SPAWN_END_TICKS && mobTicks % MOB_SPAWN_WAVE_TIME == 0 && !worldObj.isRemote) {
            for(int i = 0; i < 3 + worldObj.rand.nextInt(2); i++) {
              EntityLiving entity = null;
              switch(worldObj.rand.nextInt(2)) {
              case 0 : {
                entity = new EntityZombie(worldObj);
                if(worldObj.rand.nextInt(12) == 0)
                  entity = new EntityWitch(worldObj);
               
                break;
              }
              case 1 : {
                entity = new EntitySkeleton(worldObj);
                ((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.bow));
                if(worldObj.rand.nextInt(8) == 0) {
                  ((EntitySkeleton) entity).setSkeletonType(1);
                  ((EntitySkeleton) entity).setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword));
                }
                break;
              }
              case 3 : {
                for(int j = 0; j < 1 + worldObj.rand.nextInt(5); j++) {
                  EntityPixie pixie = new EntityPixie(worldObj);
                  pixie.setProps(players.get(rand.nextInt(players.size())), this, 1, 8);
                  pixie.setPosition(posX + width / 2, posY + 2, posZ + width / 2);
                  worldObj.spawnEntityInWorld(pixie);
                }
              }
              }
             
              if(entity != null) {
                range = 6F;
                entity.setPosition(posX + 0.5 + Math.random() * range - range / 2, posY - 1, posZ + 0.5 + Math.random() * range - range / 2);
                worldObj.spawnEntityInWorld(entity);
              }
            }
          }

View Full Code Here

    {
      Iterator<EntityLiving> var7 = var6.iterator();
     
      while (var7.hasNext())
      {
        EntityLiving var8 = var7.next();
       
        if (var8.getLeashed() && var8.getLeashedToEntity() == player)
        {
          count = count + 1;
        }
      }
    }
View Full Code Here

        Entity e = getEntity(meta);
        list.add("\u00A7" + (e instanceof IMob ? "4" : "3") + IDtoNameMap.get(meta));
    }

    public static EntityLiving getEntity(int ID) {
        EntityLiving e = entityHashMap.get(ID);
        if (e == null) {
            World world = NEIClientUtils.mc().theWorld;
            loadSpawners(world);
            Class<?> clazz = (Class<?>) EntityList.IDtoClassMapping.get(ID);
            try {
View Full Code Here

        HashMap<Class<Entity>, Integer> classToIDMapping = (HashMap<Class<Entity>, Integer>) EntityList.classToIDMapping;
        for (Class<Entity> eclass : classToStringMapping.keySet()) {
            if (!EntityLiving.class.isAssignableFrom(eclass))
                continue;
            try {
                EntityLiving entityliving = (EntityLiving) eclass.getConstructor(new Class[]{World.class}).newInstance(world);
                entityliving.isChild();

                int id = classToIDMapping.get(eclass);
                String name = classToStringMapping.get(eclass);

                if (name.equals("EnderDragon"))
View Full Code Here

        {
            d0 = 0.5D;
        }

        int damage = stack.getItemDamage();
        EntityLiving entity = null;
        switch (damage)
        {
        case 0:
            entity = new ImpEntity(world);
            spawnEntity(posX, posY, posZ, entity, world);
View Full Code Here

        double posX = particle.posX + approachSpeed * Math.cos(radians);
        double posY = particle.posY;
        double posZ = particle.posZ + approachSpeed * Math.sin(radians);
        if (target instanceof EntityLiving)
        {
            EntityLiving entityliving = (EntityLiving) target;
            deltaY = posY - (entityliving.posY + entityliving.getEyeHeight());
        }
        else if (target instanceof EntityItem)
            deltaY = posY - target.posY;
        else
            deltaY = (target.boundingBox.minY + target.boundingBox.maxY) / 2.0D - posY;
View Full Code Here

        double posY = particle.posY;
        double posZ = particle.posZ + fleeSpeed * Math.sin(radians);

        if (target instanceof EntityLiving)
        {
            EntityLiving entityliving = (EntityLiving) target;
            deltaY = posY - (entityliving.posY + entityliving.getEyeHeight());
        }
        else
            deltaY = (target.boundingBox.minY + target.boundingBox.maxY) / 2.0D - posY;
        double horizontalDistance = MathHelper.sqrt_double(deltaX * deltaX + deltaZ * deltaZ);
        float pitchRotation = (float) -Math.atan2(deltaY, horizontalDistance);
View Full Code Here

        tag.setShort("Anger", (short)0);
        tag.setInteger("Age", living.isChild() ? -24000 : 0);

        if(living instanceof EntityLiving)
        {
            EntityLiving living1 = (EntityLiving)living;

            NBTTagList tagList = new NBTTagList();

            for (int i = 0; i < living1.getLastActiveItems().length; ++i)
            {
                tagList.appendTag(new NBTTagCompound());
            }

            tag.setBoolean("CanPickUpLoot", true);
View Full Code Here

TOP

Related Classes of net.minecraft.entity.EntityLiving

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.