Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void potion(InventoryHolder holder, ItemStack item) {
- if(item.getItemMeta().getLore().contains(ChatColor.GRAY + "Night Vision I")){
- if (holder instanceof Player){
- Player p = (Player) holder;
- if (p.getInventory().getHelmet() == null || p.getInventory().getHelmet().getType() == Material.AIR) {
- //p.sendMessage("Adding potion...");
- p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0));
- } else {
- //p.sendMessage("Removing potion...");
- p.removePotionEffect(PotionEffectType.NIGHT_VISION);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment