Discussion in 'Plugin Development' started by tschagg, Mar 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    hey guys, i've a little problem with that event...
      public void onPlayerInteractEvent(PlayerInteractEvent e){
        Player player = (Player) e.getPlayer();
        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:

    any idea where the fault is?

    thank you!
  2. Offline


    What do you have on line 63?
  3. Offline


    on line 63 is a } the second last.
  4. Offline


    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.
Thread Status:
Not open for further replies.

Share This Page