Package net.minecraft.potion

Examples of net.minecraft.potion.PotionEffect


      server.getConfigurationManager().syncPlayerInventory(player);
      Iterator iterator = player.getActivePotionEffects().iterator();

      while(iterator.hasNext())
      {
        PotionEffect potioneffect = (PotionEffect)iterator.next();
        player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
      }

      FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, id, coord.dimensionId);
    }
View Full Code Here


    protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
    {
        if (!world.isRemote)
        {
            int duration = 0;
            PotionEffect potion;
            switch (stack.getItemDamage())
            {
            case 0:
                potion = player.getActivePotionEffect(Potion.hunger);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.hunger.id, duration + 8 * 20, 0));
                player.setFire(10);

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.poison);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 5 * 20, 0));
                }
                break;

            case 1:
                potion = player.getActivePotionEffect(Potion.fireResistance);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, duration + 15 * 20, 0));

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.poison);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 5 * 20, 0));
                }
                break;
            }
        }
    }
View Full Code Here

    protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
    {
        if (!world.isRemote && stack.getItemDamage() / 14 == 1)
        {
            int duration = 0;
            PotionEffect potion;

            potion = player.getActivePotionEffect(Potion.nightVision);
            if (potion != null)
                duration = potion.getDuration();
            else
                duration = 0;
            player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 45 * 25, 0));

            potion = player.getActivePotionEffect(Potion.weakness);
            if (potion != null)
                duration = potion.getDuration();
            else
                duration = 0;
            player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 16 * 25, 0));

            potion = player.getActivePotionEffect(Potion.weakness);
            if (potion != null)
                duration = potion.getDuration();
            else
                duration = 0;
            player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, duration + 8 * 25, 0));
        }
    }
View Full Code Here

    protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
    {
        if (!world.isRemote)
        {
            int duration = 0;
            PotionEffect potion;
            switch (stack.getItemDamage())
            {
            case 0:
                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.poison);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 2 * 25, 0));
                }
                break;
            }
        }
    }
View Full Code Here

    protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player)
    {
        if (!world.isRemote)
        {
            int duration = 0;
            PotionEffect potion;
            switch (stack.getItemDamage())
            {
            case 0:
                potion = player.getActivePotionEffect(Potion.regeneration);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 8 * 20, 0));

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.poison);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.poison.id, duration + 5 * 20, 0));
                }
                if (Natura.random.nextFloat() < 0.15f)
                {
                    potion = player.getActivePotionEffect(Potion.wither);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.wither.id, duration + 5 * 20, 0));
                }
                break;

            case 1:
                potion = player.getActivePotionEffect(Potion.nightVision);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.nightVision.id, duration + 15 * 20, 0));

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.blindness);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.blindness.id, duration + 3 * 20, 0));
                }
                break;

            case 2:
                potion = player.getActivePotionEffect(Potion.jump);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.jump.id, duration + 8 * 20, 0));

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.moveSlowdown);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration + 3 * 20, 0));
                }
                break;

            case 3:
                potion = player.getActivePotionEffect(Potion.damageBoost);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, duration + 10 * 20, 0));

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.digSlowdown);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, duration + 10 * 20, 0));
                }
                break;

            case 4:
                potion = player.getActivePotionEffect(Potion.digSpeed);
                if (potion != null)
                    duration = potion.getDuration();
                player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, duration + 10 * 20, 0));

                if (Natura.random.nextFloat() < 0.75f)
                {
                    potion = player.getActivePotionEffect(Potion.weakness);
                    if (potion != null)
                        duration = potion.getDuration();
                    else
                        duration = 0;
                    player.addPotionEffect(new PotionEffect(Potion.weakness.id, duration + 10 * 20, 0));
                }
                break;
            }
        }
    }
View Full Code Here

        }

        if (entity instanceof EntityLiving)
        {
            EntityLiving living = (EntityLiving) entity;
            living.addPotionEffect(new PotionEffect(Potion.confusion.id, 100, 0));
        }
    }
View Full Code Here

        if (entity instanceof EntityLivingBase)
        {
            int meta = world.getBlockMetadata(x, y, z);
            if (meta == 0)
            {
                ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, 1));
            }
            else if (meta == 1)
            {
                NContent.heatSand.onEntityCollidedWithBlock(world, x, y, z, entity);
            }
View Full Code Here

        List<?> entities = worldObj.getEntitiesWithinAABB(EntityLiving.class, a.toAxisAlignedBB());
        for(Object o : entities)
        {
          if(o instanceof EntityPlayer)
          {
            ((EntityPlayer)o).addPotionEffect(new PotionEffect(Potion.hunger.id, 20 * 20, 0));
          }
          if(o instanceof EntityPlayer)
          {
            ((EntityPlayer)o).addPotionEffect(new PotionEffect(Potion.poison.id, 6 * 20, 0));
          }
        }
        _tick = 0;
      }
      return true;
View Full Code Here

  }

  @Override
  public void onWornTick(ItemStack itemstack, EntityLivingBase player) {
    if (itemstack.getItemDamage()==0 && !player.isPotionActive(Potion.digSpeed)) {
      player.addPotionEffect(new PotionEffect(Potion.digSpeed.id,40,0,true));
    }
  }
View Full Code Here

    EntityTNTPrimed armedTNT = (EntityTNTPrimed)MFRUtil.prepareMob(EntityTNTPrimed.class, world);
    armedTNT.fuse = 120;
    mobs.add(new RandomMob(armedTNT, 5));
   
    EntitySlime invisislime = (EntitySlime)MFRUtil.prepareMob(EntitySlime.class, world);
    invisislime.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisislime, 5));
   
    EntityMooshroom invisishroom = (EntityMooshroom)MFRUtil.prepareMob(EntityMooshroom.class, world);
    invisishroom.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisishroom, 5));
   
    EntitySkeleton skeleton1 = (EntitySkeleton)MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton2 = (EntitySkeleton)MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton3 = (EntitySkeleton)MFRUtil.prepareMob(EntitySkeleton.class, world);
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.