Package net.minecraft.potion

Examples of net.minecraft.potion.PotionEffect


            used = true;
      }
      //Handle potion effects
      for(PotionEffect effect : type.potionEffects)
      {
        player.addPotionEffect(new PotionEffect(effect));
        used = true;
      }
      //Handle ammo
      if(type.numClips > 0 && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemGun)
      {
View Full Code Here


  public PotionEffect getPotionEffect(String[] split)
  {
    int potionID = Integer.parseInt(split[1]);
    int duration = Integer.parseInt(split[2]);
    int amplifier = Integer.parseInt(split[3]);
    return new PotionEffect(potionID, duration, amplifier, false);
  }
View Full Code Here

  {
    if(bullet.type.setEntitiesOnFire)
      player.setFire(20);
    for(PotionEffect effect : bullet.type.hitEffects)
    {
      player.addPotionEffect(new PotionEffect(effect));
    }
    float damageModifier = bullet.type.penetratingPower < 0.1F ? penetratingPower / bullet.type.penetratingPower : 1;
    switch(type)
    {
    case BODY : break;
View Full Code Here

 
  @Override
    public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
    {
    if(type.nightVision && FlansMod.ticker % 25 == 0)
      player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 250));
    }
View Full Code Here

          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

            return;
        }

        dur = parseIntWithMin(sender, args[2], 0) * 20;

        PotionEffect eff = new PotionEffect(ID, dur, ampl);
        if (args[0].equalsIgnoreCase("me"))
        {
            sender.addPotionEffect(eff);
        }
        else if (PermissionsManager.checkPermission(sender, getPermissionNode() + ".others"))
View Full Code Here

            OutputHandler.chatError(sender, "Improper syntax. Please try this instead: <player> <effect> <duration> [ampl]");
            return;
        }

        dur = parseIntWithMin(sender, args[2], 0) * 20;
        PotionEffect eff = new PotionEffect(ID, dur, ampl);

        EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);

        if (player != null)
        {
View Full Code Here

    NBTTagList effectList = (NBTTagList)StackUtils.getTag(stack, "Effects");
    if ((effectList != null) && (handler != null)) {
      int max = (advancedTooltips ? 8 : 3);
     
      for (int i = 0; i < Math.min(effectList.tagCount(), max); i++) {
        PotionEffect effect = PotionEffect.readCustomPotionEffectFromNBT(
            effectList.getCompoundTagAt(i));
        Potion potion = Potion.potionTypes[effect.getPotionID()];
        int duration = (int)(effect.getDuration() * handler.durationMultiplier());
       
        StringBuilder str = new StringBuilder()
          .append(potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY)
          .append(StatCollector.translateToLocal(effect.getEffectName()));
        if (effect.getAmplifier() > 0)
          str.append(" ").append(StatCollector.translateToLocal("potion.potency." + effect.getAmplifier()));
        str.append(" (").append(StringUtils.ticksToElapsedTime(duration)).append(")");
       
        list.add(str.toString());
      }
     
View Full Code Here

    if (handler != null) {
      player.getFoodStats().addStats(handler.foodAmount(), handler.saturationAmount());
      NBTTagList effectList = (NBTTagList)StackUtils.getTag(stack, "Effects");
      if (effectList != null) {
        for (int i = 0; i < effectList.tagCount(); i++) {
          PotionEffect effect = PotionEffect.readCustomPotionEffectFromNBT(effectList.getCompoundTagAt(i));
          int duration = (int)(effect.getDuration() * handler.durationMultiplier());
          effect = new PotionEffect(effect.getPotionID(), duration, effect.getAmplifier());
          player.addPotionEffect(effect);
        }
      }
      handler.onEaten(player, false);
    }
View Full Code Here

    public float durationMultiplier() { return 0.25F; }
   
    /** Called when this slime is eaten, allows adding effects to the player
     *  in addition to the potion effects of the slime itself. */
    public void onEaten(EntityPlayer player, boolean potionEffects) {
      player.addPotionEffect(new PotionEffect(Potion.jump.id, (potionEffects ? 6 : 16) * 20, 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.