Examples of PotionEffect


Examples of org.bukkit.potion.PotionEffect

        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

Examples of org.bukkit.potion.PotionEffect

      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

Examples of org.bukkit.potion.PotionEffect

    // 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

Examples of org.bukkit.potion.PotionEffect

    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

Examples of org.bukkit.potion.PotionEffect

    } 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

Examples of org.bukkit.potion.PotionEffect

    } 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

Examples of org.bukkit.potion.PotionEffect

   * @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

Examples of org.bukkit.potion.PotionEffect

        // 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

Examples of org.bukkit.potion.PotionEffect

            switch (Action.valueOf(state.asString().toUpperCase())) {
                case FALSE:
                    target.getLivingEntity().removePotionEffect(PotionEffectType.INVISIBILITY);
                    break;
                case TRUE:
                    new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1).apply(target.getLivingEntity());
                    break;
                case TOGGLE:
                    if (target.getLivingEntity().hasPotionEffect(PotionEffectType.INVISIBILITY))
                        target.getLivingEntity().removePotionEffect(PotionEffectType.INVISIBILITY);
                    else
                        new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1).apply(target.getLivingEntity());
                    break;
            }
        }
    }
View Full Code Here

Examples of org.bukkit.potion.PotionEffect

          mobEffectModifier = new StructureModifier<Object>(MinecraftReflection.getMobEffectClass(), false);
        }
        StructureModifier<Integer> ints = mobEffectModifier.withTarget(generic).withType(int.class);
        StructureModifier<Boolean> bools = mobEffectModifier.withTarget(generic).withType(boolean.class);
       
        return new PotionEffect(
          PotionEffectType.getById(ints.read(0)),   /* effectId */
          ints.read(1),                  /* duration */
          ints.read(2),                 /* amplification */
          bools.read(1)                /* ambient */
        );
 
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.