Package net.minecraft.potion

Examples of net.minecraft.potion.PotionEffect


  @Override
  public List getEffects(int par1) {
    List r = new ArrayList();
    switch (par1) {
      case 0:
        r.add(new PotionEffect(ModPotions.potionAirId, 3600));
        break;
      case 1:

        r.add(new PotionEffect(ModPotions.potionFireId, 3600));
        break;
      case 2:

        r.add(new PotionEffect(ModPotions.potionEarthId, 3600));
        break;
      case 3:

        r.add(new PotionEffect(ModPotions.potionWaterId, 3600));
        break;
    }

    return r;
  }
View Full Code Here


          break;
        }
        case 2: {
          EntityLivingBase living = (EntityLivingBase) entity;
          PotionEffect effect = new PotionEffect(Potion.resistance.id, 1, 1);
          living.addPotionEffect(effect);

          SoulHeartHandler.addHearts(player);

          break;
View Full Code Here

    ItemStack armor = player.getCurrentArmor(3);
    if (player.isInsideOfMaterial(Material.water)
        && ThaumicTinkerer.proxy.armorStatus(player)
        && armor.getItemDamage() == 0) {
      player.setAir(300);
      PotionEffect effect = player
          .getActivePotionEffect(Potion.nightVision);

      if (effect != null && effect.duration <= 202)
        effect.duration = 202;
      else
        player.addPotionEffect(new PotionEffect(Potion.nightVision.id,
            202, 0, true));
    }
    if (player.isInsideOfMaterial(Material.lava)
        && ThaumicTinkerer.proxy.armorStatus(player)
        && armor.getItemDamage() == 0) {
      player.setAir(300);
      PotionEffect effect = player
          .getActivePotionEffect(Potion.blindness);

      if (effect != null && effect.duration <= 202)
        effect.duration = 202;
      else
        player.addPotionEffect(new PotionEffect(Potion.blindness.id,
            202, 0, true));
    }
    int food = player.getFoodStats().getFoodLevel();
    if (food > 0 && food < 18 && player.shouldHeal()
        && player.ticksExisted % 80 == 0)
View Full Code Here

  @Override
  void tickPlayer(EntityPlayer player) {
    ItemStack armor = player.getCurrentArmor(0);
    if (!ThaumicTinkerer.proxy.armorStatus(player) || armor.getItemDamage() == 1)
      return;
    player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2, 1, true));

    if (player.worldObj.isRemote)
      player.stepHeight = player.isSneaking() ? 0.5F : 1F;
    if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)
      player.moveFlying(0F, 1F, player.capabilities.isFlying ? 0.075F : 0.15F);
View Full Code Here

    manager.updateTimeAndWeatherForPlayer(player, worldserver1);
    manager.syncPlayerInventory(player);
    Iterator<PotionEffect> iterator = player.getActivePotionEffects().iterator();

    while (iterator.hasNext()) {
      PotionEffect potioneffect = iterator.next();
      player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
    }
    FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDim, dimension);
  }
View Full Code Here

    }
    return super.getReachDistanceForPlayer(entityPlayer);
  }
 
  public void setInstantConfusionOnPlayer(EntityPlayer ent, int duration) {
    ent.addPotionEffect(new PotionEffect(Potion.confusion.getId(), duration, 1, true));
    Minecraft.getMinecraft().thePlayer.timeInPortal = 1;
  }
View Full Code Here

  public boolean isNeiInstalled() {   
    return false;
  }

  public void setInstantConfusionOnPlayer(EntityPlayer ent, int duration) {
    ent.addPotionEffect(new PotionEffect(Potion.confusion.getId(), duration, 1, true));   
  }
View Full Code Here

    }

    if(this == EnderIO.blockFireWater) {
      entity.setFire(50);
    } else if(this == EnderIO.blockRocketFuel && entity instanceof EntityLivingBase) {
      ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.jump.id, 150, 3, true));
    } else if(this == EnderIO.blockNutrientDistillation && entity instanceof EntityPlayerMP) {
      long time = entity.worldObj.getTotalWorldTime();
      EntityPlayerMP player = (EntityPlayerMP) entity;
      if(time % Config.nutrientFoodBoostDelay == 0 && player.getEntityData().getLong("eioLastFoodBoost") != time) {
        player.getFoodStats().addStats(1, 0.1f);
        player.getEntityData().setLong("eioLastFoodBoost", time);
      }
    } else if (this == EnderIO.blockHootch && entity instanceof EntityLivingBase) {
      ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 150, 0, true));
    }

    super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, entity);
  }
View Full Code Here

  }
 
 
  private void updateNightvision(EntityPlayer player) {
    if(isNightVisionUpgradeEquipped(player) && nightVisionActive) {
      player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 210, 0, true));
    }
    if(!isNightVisionUpgradeEquipped(player) && nightVisionActive) {
      nightVisionActive = false;
      removeNightvision = true;
    }
View Full Code Here

        if (new Vector3(entity).distance(new Vector3(x, y, z).add(0.4)) < 0.5)
        {
          if (entity instanceof EntityLiving && !world.isRemote)
          {
            ((EntityLiving) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 4 * 20, 3));
            ((EntityLiving) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, 1));

            boolean hasPermission = false;

            List<EntityPlayer> entities = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 0.9, z + 1));

View Full Code Here

TOP

Related Classes of net.minecraft.potion.PotionEffect

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.