Package net.minecraft.potion

Examples of net.minecraft.potion.PotionEffect


          potionEffects.addAll(effects);
      }
   
    for (PotionEffect effect : potionEffects) {
      Potion potion = Potion.potionTypes[effect.getPotionID()];
      PotionEffect active = player.getActivePotionEffect(potion);
      effect = new SmallPotionEffect(effect, active);
      player.addPotionEffect(effect);
    }
   
    player.worldObj.playSoundAtEntity(player, "random.drink", 0.5F, 0.9F + player.worldObj.rand.nextFloat() * 0.1F);
 
View Full Code Here


        potionEffects = config.get(category, "potionEffects", potionEffects, "Format like this: 'ID:duration:amplifier'").getStringList();

        for (String poisonEffect : potionEffects)
        {
            String[] split = poisonEffect.split(":");
            potionEffectsList.add(new PotionEffect(Integer.parseInt(split[0]), Integer.parseInt(split[1]) * 20, Integer.parseInt(split[2])));
        }
    }
View Full Code Here

        String[] array = config.get(category, "potionEffects", new String[] { "4:150:1" }, "Format like this: 'ID:duration:amplifier'").getStringList();

        for (String string : array)
        {
            String[] split = string.split(":");
            RespawnDebuffHandler.potionEffects.add(new PotionEffect(Integer.parseInt(split[0]), Integer.parseInt(split[1]) * 20, Integer.parseInt(split[2])));
        }
    }
View Full Code Here

  public BeverageEffectDrunk(int id, float chance) {
    super(id);
    this.chance = chance;
    this.description = "beverage.effect.alcoholic";
    drunkEffect = new PotionEffect(Potion.confusion.id, 25 * 20, 0);
  }
View Full Code Here

      else if (count > 1)
        duration = 400;
      else if (count > 0)
        duration = 600;

      player.addPotionEffect(new PotionEffect(Potion.poison.id, duration, 0));
    }

    return storedData;
  }
View Full Code Here

    @SuppressWarnings("rawtypes")
    List list = housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, beatifyBox);

    for (Object obj : list) {
      EntityPlayer player = (EntityPlayer) obj;
      player.addPotionEffect(new PotionEffect(potionId, duration, 0));
    }

    return storedData;
  }
View Full Code Here

       
    if (player.getCurrentItemOrArmor(1) != null){
      ItemStack boots1 = player.getCurrentItemOrArmor(1);
     
      if(helmet1.getItem() == MechaniCraft.EndHelmet || chestplate1.getItem() == MechaniCraft.EndChestplate || leggings1.getItem() == MechaniCraft.EndLeggings || boots1.getItem() == MechaniCraft.EndBoots){
        player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 220, 0));
          }
        }
      }
    }
  }
   
    if (player.getCurrentItemOrArmor(4) != null){
      ItemStack helmet2 = player.getCurrentItemOrArmor(4);
     
    if (player.getCurrentItemOrArmor(3) != null){
      ItemStack chestplate2 = player.getCurrentItemOrArmor(3);
       
    if (player.getCurrentItemOrArmor(2) != null){
      ItemStack leggings2 = player.getCurrentItemOrArmor(2);
       
    if (player.getCurrentItemOrArmor(1) != null){
      ItemStack boots2 = player.getCurrentItemOrArmor(1);
     
      if(helmet2.getItem() == MechaniCraft.ObsidianHelmet || chestplate2.getItem() == MechaniCraft.ObsidianChestplate || leggings2.getItem() == MechaniCraft.ObsidianLeggings || boots2.getItem() == MechaniCraft.ObsidianBoots){
        player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 220, 0));
          }
        }
      }
    }
  }
   
    if (player.getCurrentItemOrArmor(4) != null){
      ItemStack helmet3 = player.getCurrentItemOrArmor(4);
     
    if (player.getCurrentItemOrArmor(3) != null){
      ItemStack chestplate3 = player.getCurrentItemOrArmor(3);
       
    if (player.getCurrentItemOrArmor(2) != null){
      ItemStack leggings3 = player.getCurrentItemOrArmor(2);
       
    if (player.getCurrentItemOrArmor(1) != null){
      ItemStack boots3 = player.getCurrentItemOrArmor(1);
     
      if(helmet3.getItem() == MechaniCraft.PureHelmet || chestplate3.getItem() == MechaniCraft.PureChestplate || leggings3.getItem() == MechaniCraft.PureLeggings || boots3.getItem() == MechaniCraft.PureBoots){
        player.addPotionEffect(new PotionEffect(Potion.field_76443_y.getId(), 220, 0));
          }
        }
      }
    }
    }
   
    if (player.getCurrentItemOrArmor(4) != null){
      ItemStack helmet4 = player.getCurrentItemOrArmor(4);
     
    if (player.getCurrentItemOrArmor(3) != null){
      ItemStack chestplate4 = player.getCurrentItemOrArmor(3);
       
    if (player.getCurrentItemOrArmor(2) != null){
      ItemStack leggings4 = player.getCurrentItemOrArmor(2);
       
    if (player.getCurrentItemOrArmor(1) != null){
      ItemStack boots4 = player.getCurrentItemOrArmor(1);
     
      if(helmet4.getItem() == MechaniCraft.EvilHelmet || chestplate4.getItem() == MechaniCraft.EvilChestplate || leggings4.getItem() == MechaniCraft.EvilLeggings || boots4.getItem() == MechaniCraft.EvilBoots){
        player.addPotionEffect(new PotionEffect(Potion.confusion.getId(), 220, 0));
          }
        }
      }
    }
  }
View Full Code Here

              drawTexturedModalRect(x, y, MARGIN + 45, TOP, 9, 9); // 5
          }
        }

        int potionOffset = 0;
        PotionEffect potion = mc.thePlayer.getActivePotionEffect(Potion.wither);
        if (potion != null)
          potionOffset = 18;
        potion = mc.thePlayer.getActivePotionEffect(Potion.poison);
        if (potion != null)
          potionOffset = 9;
View Full Code Here

                    {
                        Iterator iterator = list.iterator();

                        while (iterator.hasNext())
                        {
                            PotionEffect potioneffect = (PotionEffect) iterator.next();
                            ((EntityLivingBase) triggerer).addPotionEffect(new PotionEffect(potioneffect));
                        }
                    }
                }
            }
        }
View Full Code Here

    protected void onFoodEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability)
        {
            par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier));
        }
    }
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.