Solved Ender chest Null as Inventory Holder

Discussion in 'Plugin Development' started by CorrieKay, Dec 13, 2012.

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

    CorrieKay

    In my multiworld system im creating, i am trying to restrict enderchest usage to a specific set of worlds.

    Instead of listening to an interact event and cancelling if theyre clicking an enderchest, im listening to the inventory open event. Thing is, when i try to check if the inventory holder is an enderchest, the inventory holder returns null.

    I found this bug report But it says that its not actually a bug.

    So two questions
    1) any other alternatives?
    2) why does the inventory holder return null with ender chests?
     
  2. Offline

    SoThatsIt

    it returns null because an ender chest doesnt have an inventory as such. when you open an enderchest it opens one inventory each time not one per ender chest.

    Also if it is just an enderchest that returns null you could just check if it is null and then you would know it is an ender chest
     
  3. Offline

    fireblast709

    Saves a lot of memory and disk space ;3 (as you have only one, player bound, instead of 1 per enderchest). Besides, how would 2 players use the same enderchest, and get different inventories if the enderchest was the holder :3
     
  4. Offline

    CorrieKay

    Ah right. Thaaaats why it returns null. Hmm..

    I guess ill just cancel the interact event and hope for the best xD
     
Thread Status:
Not open for further replies.

Share This Page