Get location of a chest?

Discussion in 'Plugin Development' started by isleepzzz, Jan 25, 2015.

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

    isleepzzz

    Hey guys!
    So, I have this so far:
    public void onInventoryOpenEvent(InventoryOpenEvent e){

    if (e.getInventory().getHolder() instanceof Chest){

    }

    }

    So, I cannot figure out how to get the location of the chest that is trying to get opened?
    Can anyone help me please :/
     
  2. Offline

    teej107

  3. Offline

    isleepzzz

  4. Offline

    Skionz

  5. Offline

    isleepzzz

    I wish it was that simple.
    But Chest.getLocation() is not working at all.
    I actually see no methods whenever I just type Chest. anything.
     
  6. Offline

    Skionz

    @isleepzzz getLocation() is not static. Notice how Chest extends BlockState as @teej107 has mentioned.
     
  7. Offline

    isleepzzz

    I know man.. I'm just not this skilled yet, or I'm just not seeing it :/
     
  8. Offline

    Skionz

    TGRHavoc likes this.
  9. Offline

    isleepzzz

    Lmfao I like your persistence of just not spoon feeding me :p
    I think I got it!:D
    I'm doing tests on it right now:)

    Alright man! I got it all working, however for some odd reason it is not taking my "Vote Key" which is just a tripwire hook :(
    Do you see anything wrong?
    http://pastebin.com/fzEZcEWM

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
    Skionz likes this.
  10. Offline

    teej107

    @isleepzzz One (or more) of your if statements is false. Put in debug code.
     
  11. Offline

    isleepzzz

    I fixed it. I was calling getInventory from the chest and not the player.
    Thank you though! :)
     
Thread Status:
Not open for further replies.

Share This Page