Package net.minecraft.entity

Examples of net.minecraft.entity.EntityLivingBase


      FlansMod.getPacketHandler().sendToAllAround(new PacketFlak(posX, posY, posZ, 50, type.smokeParticleType), posX, posY, posZ, 30, dimension);
      //
      List list = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox.expand(type.smokeRadius, type.smokeRadius, type.smokeRadius));
      for(Object obj : list)
      {
        EntityLivingBase entity = ((EntityLivingBase)obj);
        if(entity.getDistanceToEntity(this) < type.smokeRadius)
        {
          //Do some checks first
          boolean smokeThem = true;
          for(int i = 0; i < 5; i++)
          {
            //If any currently equipped item has smoke protection (gas masks), stop the effects
            ItemStack stack = entity.getEquipmentInSlot(i);
            if(stack != null && stack.getItem() instanceof ItemTeamArmour)
            {
              if(((ItemTeamArmour)stack.getItem()).type.smokeProtection)
                smokeThem = false;
            }
          }
         
          if(smokeThem)
            for(PotionEffect effect : type.smokeEffects)
              entity.addPotionEffect(new PotionEffect(effect));
        }
      }
     
      smokeTime--;
      if(smokeTime == 0)
View Full Code Here


   
    Vector3f actualMotion = new Vector3f(0F, motionY - (16F / 400F), 0F);
   
    if(driverIsLiving)
    {
      EntityLivingBase entity = (EntityLivingBase)seats[0].riddenByEntity;
      boolean driverIsCreative = entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode;
      if(thePlayerIsDrivingThis && Minecraft.getMinecraft().currentScreen instanceof GuiDriveableController)
      {
        if(FlansMod.proxy.isKeyDown(0)) moveX = 1;
        if(FlansMod.proxy.isKeyDown(1)) moveX = -1;
View Full Code Here

  }

  @SubscribeEvent
  public void onEntityHurt(LivingHurtEvent event)
  {
    EntityLivingBase entity = event.entityLiving;
    if(event instanceof LivingHurtEvent && (entity.ridingEntity instanceof EntityDriveable || entity.ridingEntity instanceof EntitySeat))
    {
      event.ammount = 0;
    }
  }
View Full Code Here

  }
 
  @SubscribeEvent
  public void onEntityKilled(LivingDeathEvent event)
  {
    EntityLivingBase entity = event.entityLiving;
    if(entity instanceof EntityPlayer)
    {
      getPlayerData((EntityPlayer)entity).playerKilled();
    }
  }
View Full Code Here

    }
   
    //Render off-hand gun
    if(gunType.oneHanded && type == ItemRenderType.EQUIPPED_FIRST_PERSON)
    {
      EntityLivingBase entity = (EntityLivingBase)data[1];
      if(entity instanceof EntityPlayer)
      {
        EntityPlayer player = (EntityPlayer)entity;
        PlayerData playerData = PlayerHandler.getPlayerData(player, Side.CLIENT);
        if(playerData.offHandGunSlot != 0)
View Full Code Here

                else if(bulletHit instanceof EntityHit)
                {
                  EntityHit entityHit = (EntityHit)bulletHit;
                  if(entityHit.entity.attackEntityFrom(DamageSource.causePlayerDamage(player), swingDistance * type.meleeDamage) && entityHit.entity instanceof EntityLivingBase)
                  {
                    EntityLivingBase living = (EntityLivingBase)entityHit.entity;
                    //If the attack was allowed, we should remove their immortality cooldown so we can shoot them again. Without this, any rapid fire gun become useless
                    living.arrowHitTimer++;
                    living.hurtResistantTime = living.maxHurtResistantTime / 2;
                  }
                 
View Full Code Here

        else if(bulletHit instanceof EntityHit)
        {
          EntityHit entityHit = (EntityHit)bulletHit;
          if(entityHit.entity.attackEntityFrom(getBulletDamage(false), damage * type.damageVsLiving) && entityHit.entity instanceof EntityLivingBase)
          {
            EntityLivingBase living = (EntityLivingBase)entityHit.entity;
            for(PotionEffect effect : type.hitEffects)
            {
              living.addPotionEffect(new PotionEffect(effect));
            }
            //If the attack was allowed, we should remove their immortality cooldown so we can shoot them again. Without this, any rapid fire gun become useless
            living.arrowHitTimer++;
            living.hurtResistantTime = living.maxHurtResistantTime / 2;
          }
View Full Code Here

          }
 
          if(!world.isRemote && type.healPlayers)
          {
            //By default, heal the player
            EntityLivingBase hitLiving = entityplayer;
           
        //Iterate over entities within range of the ray
        List list = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(
            Math.min(posVec.xCoord, lookVec.xCoord), Math.min(posVec.yCoord, lookVec.yCoord), Math.min(posVec.zCoord, lookVec.zCoord),
            Math.max(posVec.xCoord, lookVec.xCoord), Math.max(posVec.yCoord, lookVec.yCoord), Math.max(posVec.zCoord, lookVec.zCoord)));
        for (int l = 0; l < list.size(); l++)
        {
          if(!(list.get(l) instanceof EntityLivingBase))
            continue;
          EntityLivingBase checkEntity = (EntityLivingBase)list.get(l);
          //Don't check the player using it
          if(checkEntity == entityplayer)
            continue;
          //Do a more accurate ray trace on this entity
          MovingObjectPosition hit = checkEntity.boundingBox.calculateIntercept(posVec, lookVec);
View Full Code Here

        !(event.target instanceof EntityLivingBase) ||
        ((event.target instanceof EntityPlayer) &&
         !BetterStorage.globalConfig.getBoolean(GlobalConfig.enableBackpackInteraction))) return;
   
    EntityPlayerMP player = (EntityPlayerMP)event.entity;
    EntityLivingBase target = (EntityLivingBase)event.target;
    if (ItemBackpack.openBackpack(player, target))
      player.swingItem();
   
  }
View Full Code Here

 
  @SubscribeEvent
  public void onSpecialSpawn(SpecialSpawn event) {
   
    // When a mob spawns naturally, see if it has a chance to spawn with a backpack.
    EntityLivingBase entity = event.entityLiving;
    World world = entity.worldObj;
    double probability = 0.0;
   
    for (BetterStorageBackpack.BackpackSpawnEntry entry : BetterStorageBackpack.spawnWithBackpack) {
      if (!entity.getClass().equals(entry.entityClass)) continue;
      probability = entry.probability;
      break;
    }
   
    if (!RandomUtils.getBoolean(probability) || entity.isChild()) return;
   
    // If entity is a vanilla enderman, replace it with a friendly one.
    if (entity.getClass().equals(EntityEnderman.class)) {
      if ((BetterStorageTiles.enderBackpack != null) &&
          // Don't spawn friendly endermen in the end or end biome, would make them too easy to get.
          (world.provider.dimensionId != 1) &&
          (world.getBiomeGenForCoords((int)entity.posX, (int)entity.posZ) != BiomeGenBase.sky)) {
        EntityFrienderman frienderman = new EntityFrienderman(world);
        frienderman.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, 0);
        world.spawnEntityInWorld(frienderman);
        ItemBackpack.getBackpackData(frienderman).spawnsWithBackpack = true;
        entity.setDead();
      }
    // Otherwise, just mark it to spawn with a backpack.
    } else if (BetterStorageTiles.backpack != null)
      ItemBackpack.getBackpackData(entity).spawnsWithBackpack = true;
   
View Full Code Here

TOP

Related Classes of net.minecraft.entity.EntityLivingBase

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.