Solved Inventory Click Event Not Sensing Inventory

Discussion in 'Plugin Development' started by Kedric, Oct 30, 2014.

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

    Kedric

    Im really seriously lost here. I have done a bunch of research and tried for hours so I think it is time to ask bukkit forums. I have a OOP that I have created registered with an event and everything, it doesn't sense the invnentory, I've tried everything else and it works but not this one? I'm very confused! Thanks for the help if you can! Here is the code:
    http://pastebin.com/FZWhem0A

    Thanks again! - Kedric
     
  2. Offline

    TheCodingCat

    try a debugger such as a System.out.println("test"); in each event and if statement to see where the problem might be occurring, or if the events are even being registered
     
  3. Offline

    Kedric

    TheCodingCat
    So I've been trying debuggers and tests and all other things, it seems as if the inventory is not registered as an inventory. It is like it doesn't sense it, I made sure it registers, it does.
     
  4. Offline

    TheCodingCat

    which inventory are you reffering to Kedric
     
  5. Offline

    Kedric

    TheCodingCat
    The Inva or inv, I have tried each one and it doesn't work.

    I still haven't advanced. Does anyone have any ideas? Its really confusing....

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  6. Offline

    xXMaTTHDXx

    Where do you open the inventory? Could I see both classes?
     
  7. Offline

    mine-care

    TheCodingCat well even if it is for debug purposes It's a bad habit to use system.out.println(); for bukkit plugins.. Please avoid it

    Also as xXMaTTHDXx said correctly, could you please post both classes?
    Thanks.
     
  8. Offline

    Kedric

    mine-care
    How I manage the QS.
    http://pastebin.com/Azq0ini7
    How I access it, http://pastebin.com/iW9ZbP6C , that is my Main class and in the onEnable the line is the QSManager.addQuestion...
    BTW its just a test question, it is for a quiz that we are going to give the players.

    Nevermind I have figured it out! ~Thanks for all those who have helped, stupid error on my part, if you are opening an inventory to another inventory and don't close the other one it doesnt register! -Thanks again! ~Kedric

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  9. Offline

    mine-care

    Kedric great its fixed ;) but have you removed the static?
    In order to acess non static methods/variables you have to create a instance of the class (new ClassName();) and then if you have lets say QA question = new QA(); you do question.method/variable
     
Thread Status:
Not open for further replies.

Share This Page