BaconIsBest

sadsadas

Aug 25th, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public static void potion(InventoryHolder holder, ItemStack item) {
  2. if(item.getItemMeta().getLore().contains(ChatColor.GRAY + "Night Vision I")){
  3. if (holder instanceof Player){
  4. Player p = (Player) holder;
  5. if (p.getInventory().getHelmet() == null || p.getInventory().getHelmet().getType() == Material.AIR) {
  6. //p.sendMessage("Adding potion...");
  7. p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0));
  8. } else {
  9. //p.sendMessage("Removing potion...");
  10. p.removePotionEffect(PotionEffectType.NIGHT_VISION);
  11. }
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment