Package org.bukkit.potion

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


      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

        LogHelper.showInfo("invalidPlayer", sender, ChatColor.RED);
        return true;
      }
    }
   
    target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, time, 0));
    LogHelper.showInfo("blindConfirm#####[" + Nicknames.getNick(target.getName()), sender, ChatColor.AQUA);
    if (sender != target){
      LogHelper.showInfo("blindNotify#####[" + Nicknames.getNick(sender.getName()), target, ChatColor.AQUA);
    }
   
View Full Code Here

      if (Handler_nanosuit.suitedPlayers.containsKey(pName)) {
        if (Handler_nanosuit.speed.contains(pName)) {
          player.removePotionEffect(PotionEffectType.SPEED);
          Handler_nanosuit.speed.remove(pName);
        } else {
          player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) (20 * CommandsEX.getConf().getDouble("nanoSuitTime")), CommandsEX.getConf().getInt("nanoSuitSpeed")));
          Handler_nanosuit.speed.add(pName);
        }
        LogHelper.showInfo("nanoSuitSpeedMode", sender);
      }
    }
View Full Code Here

    // clear potion effects
    PotionEffectHelper.clearPotionEffects(player);

    String potionEffect = team.getTeamConfig().resolveString(TeamConfig.APPLYPOTION);
    if (!potionEffect.isEmpty()) {
      PotionEffect effect = War.war.getPotionEffect(potionEffect);
      if (effect != null) {
        player.addPotionEffect(effect);
      } else {
        War.war.getLogger().log(Level.WARNING,
          "Failed to apply potion effect {0} in warzone {1}.",
View Full Code Here

    if (arr.length != 3) return null;
    try {
      PotionEffectType type = PotionEffectType.getByName(arr[0]);
      int duration = Integer.parseInt(arr[1]);
      int amplification = Integer.parseInt(arr[2]);
      return new PotionEffect(type, duration, amplification);
    } catch (RuntimeException ex) {
      return null;
    }
  }
View Full Code Here

    } else {
      for (PotionEffectType potionEffect : PotionEffectType.values())
        if ((potionEffect != null)
            && potionEffect.getName().equalsIgnoreCase(args[1]))
          if ((level > 0) && (damaged != null)) {
            damaged.addPotionEffect(new PotionEffect(potionEffect,
                Math.abs(level) * 100, Math.abs(level) - 1));
          } else if ((level < 0) && (damager != null)) {
            damager.addPotionEffect(new PotionEffect(potionEffect,
                Math.abs(level) * 100, Math.abs(level) - 1));
          }
      return;
    }
  }
View Full Code Here

    } else {
      for (PotionEffectType potionEffect : PotionEffectType.values())
        if ((potionEffect != null)
            && potionEffect.getName().equalsIgnoreCase(args[1]))
          if ((level > 0) && (struck != null)) {
            struck.addPotionEffect(new PotionEffect(potionEffect,
                Math.abs(level) * 100, Math.abs(level) - 1));
          } else if ((level < 0) && (striker != null)) {
            striker.addPotionEffect(new PotionEffect(potionEffect,
                Math.abs(level) * 100, Math.abs(level) - 1));
          }
      return;
    }
  }
View Full Code Here

   * @param dur
   *            Duration of PotionEffect
   */
  public static void potionEffect(final LivingEntity e,
      final PotionEffectType ef, final int dur) {
    e.addPotionEffect(new PotionEffect(ef, dur, 2));
  }
View Full Code Here

        // Apply the PotionEffect to the targets!
        for (dEntity entity : entities) {
            if (entity.getLivingEntity().hasPotionEffect(effect))
                entity.getLivingEntity().removePotionEffect(effect);
            if (remove) continue;
            PotionEffect potion = new PotionEffect(effect, duration.getTicksAsInt(), amplifier);
            if (!potion.apply(entity.getLivingEntity()))
                dB.echoError(scriptEntry.getResidingQueue(), "Bukkit was unable to apply '" + potion.getType().getName() + "' to '" + entity.toString() + "'.");
        }
    }
View Full Code Here

TOP

Related Classes of org.bukkit.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.