Solved Help with InventoryClickEvent!

Discussion in 'Plugin Development' started by SkillSam, Mar 14, 2014.

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

    SkillSam

    Solved: Make sure that the current item being clicked on is not null!
     
  2. Offline

    DrTURTLE2

    This is what I use, the invents name is Free Kits in the chat color of red.
    Code:java
    1. if ((inv.getTitle().equals(ChatColor.RED + "Free Kits!"))){
     
  3. Offline

    Rainy37

    I believe you have to check to see if the item you clicked != null... then do your code
     
  4. Offline

    DrTURTLE2

    SkillSam
    Code:java
    1. if ((event.getCurrentItem() != null) &&
    2. (event.getCurrentItem().getItemMeta() != null))


    Like Rainy37 said.
     
  5. Offline

    Mysticate

    the error is on line 58... can you post the line and surrounding code so we can see what is throwing the error?
     
  6. Offline

    DrTURTLE2

    Well does your inventory have a name itself like mine does? Because that's what I do and if you're not doing it the name way that may be causing the error SkillSam
     
Thread Status:
Not open for further replies.

Share This Page