hey guys, i've a little problem with that event... Code: @EventHandler public void onPlayerInteractEvent(PlayerInteractEvent e){ Player player = (Player) e.getPlayer(); if(player.getItemInHand().hasItemMeta()){ ItemStack iih = new ItemStack(player.getItemInHand()); ItemMeta im = iih.getItemMeta(); if (im.getDisplayName().equalsIgnoreCase(ChatColor.GOLD + "Weed Cookie")) { player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION , 300, 1)); } } } this gives me that errors: http://dpaste.com/1013004/ any idea where the fault is? thank you!
It can't point to a } because it's a NPE, those don't throw NPEs. If you changed the code since the, re-export it and run it to generate the error again and look at the line. Also, why are you copying the item ? Just use player.getItemInHand().getItemMeta(). You should also indent your code properly, it will help us and you to read it better.