Examples of PotionEffect


Examples of net.minecraft.potion.PotionEffect

    } else onUnequipped(stack, player);
  }

  @Override
  public void onUnequipped(ItemStack stack, EntityLivingBase player) {
    PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
    if(effect != null && effect.getAmplifier() == -42)
      player.removePotionEffect(Potion.nightVision.id);
  }
View Full Code Here

Examples of net.minecraft.potion.PotionEffect

  @Override
  public void onWornTick(ItemStack stack, EntityLivingBase player) {
    Brew brew = getBrew(stack);
    if(brew != BotaniaAPI.fallbackBrew && player instanceof EntityPlayer && !player.worldObj.isRemote) {
      EntityPlayer eplayer = (EntityPlayer) player;
      PotionEffect effect = brew.getPotionEffects(stack).get(0);
      float cost = (float) brew.getManaCost(stack) / effect.getDuration() / (1 + effect.getAmplifier()) * 2.5F;
      boolean doRand = cost < 1;
      if(ManaItemHandler.requestManaExact(stack, eplayer, (int) Math.ceil(cost), false)) {
        PotionEffect currentEffect = player.getActivePotionEffect(Potion.potionTypes[effect.getPotionID()]);
        if(currentEffect == null || currentEffect.getDuration() < 3) {
          PotionEffect applyEffect = new PotionEffect(effect.getPotionID(), 80, effect.getAmplifier());
          player.addPotionEffect(applyEffect);
        }

        if(!doRand || Math.random() < cost)
          ManaItemHandler.requestManaExact(stack, eplayer, (int) Math.ceil(cost), true);
View Full Code Here

Examples of net.minecraft.potion.PotionEffect

      ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0);

      if(amulet != null && amulet.getItem() == this) {
        event.setCanceled(true);
        player.setHealth(player.getMaxHealth());
        player.addPotionEffect(new PotionEffect(Potion.resistance.id, 300, 6));
        player.addChatMessage(new ChatComponentTranslation("botaniamisc.savedByLaurel"));
        player.worldObj.playSoundAtEntity(player, "botania:goldenLaurel", 1F, 0.3F);
        PlayerHandler.getPlayerBaubles(player).setInventorySlotContents(0, null);
      }
    }
View Full Code Here

Examples of net.minecraft.potion.PotionEffect

        onUnequipped(stack, player);
      else {
        if(player.getActivePotionEffect(Potion.digSpeed) != null)
          player.removePotionEffect(Potion.digSpeed.id);

        player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 1, true));
      }

      if(player.swingProgress == 0.25F)
        ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, true);
    }
View Full Code Here

Examples of net.minecraft.potion.PotionEffect

    }
  }

  @Override
  public void onUnequipped(ItemStack stack, EntityLivingBase player) {
    PotionEffect effect = player.getActivePotionEffect(Potion.digSpeed);
    if(effect != null && effect.getAmplifier() == 1)
      player.removePotionEffect(Potion.digSpeed.id);
  }
View Full Code Here

Examples of net.minecraft.potion.PotionEffect

    ticksTillExpire--;
    ItemNBTHelper.setInt(stack, TAG_TICKS_TILL_EXPIRE, ticksTillExpire);
    ItemNBTHelper.setInt(stack, TAG_TICKS_COOLDOWN, ticksCooldown);

    EntityPlayer player = (EntityPlayer) par3Entity;
    PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed);
    float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F;
    if(player.getCurrentEquippedItem() == stack && player.swingProgress == check && !world.isRemote)
      leftClick(player);
  }
View Full Code Here

Examples of net.minecraft.potion.PotionEffect

        if(item instanceof EntityLivingBase) {
          EntityLivingBase targetEntity = (EntityLivingBase)item;
          targetEntity.fallDistance = 0.0F;
          if(targetEntity.getActivePotionEffect(Potion.moveSlowdown) == null)
            targetEntity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 3, true));
        }

        Vector3 target3 = Vector3.fromEntityCenter(player);
        target3.add(new Vector3(player.getLookVec()).multiply(length));
        target3.y += 0.5;
View Full Code Here

Examples of net.minecraft.src.PotionEffect

    * @param id - The ID of the potion
    * @param duration - The duration the potion should run for
    * @param strength - The strength of effect to add
    */
   public void addPotionEffect(int id, int duration, int strength) {
      player.addPotionEffect(new PotionEffect(id, duration, strength));
   }
View Full Code Here

Examples of org.bukkit.potion.PotionEffect

      }
    }

    for (Player player : Bukkit.getOnlinePlayers()){
      if (sender != player){
        player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, time, 0));
        LogHelper.showInfo("blindNotify#####[" + Nicknames.getNick(sender.getName()), player, ChatColor.AQUA);
      }
    }
    LogHelper.showInfo("blindAllConfirm", sender, ChatColor.AQUA);
    return true;
View Full Code Here

Examples of org.bukkit.potion.PotionEffect

      if (Handler_nanosuit.suitedPlayers.containsKey(pName)) {
        if (Handler_nanosuit.jumps.contains(pName)) {
          player.removePotionEffect(PotionEffectType.JUMP);
          Handler_nanosuit.jumps.remove(pName);
        } else {
          player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, (int) (20 * CommandsEX.getConf().getDouble("nanoSuitTime")), CommandsEX.getConf().getInt("nanoSuitJump")));
          Handler_nanosuit.jumps.add(pName);
        }
        LogHelper.showInfo("nanoSuitJumpMode", sender);
      } else {
        LogHelper.showInfo("nanoSuitNotActivated", sender, ChatColor.RED);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.