Chest().getInventory()?

Discussion in 'Plugin Development' started by Builder4Free, Sep 11, 2012.

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

    Builder4Free

    What happened to the old method for getting a chest's inventory? Am I doing something wrong? This doesn't seem to be working.

    Code:
    Chest chest = (Chest) event.getClickedBlock().getState();
     
    Inventory inv = chest.getInventory();
    Thanks for the help ;)
     
  2. Offline

    Hoolean

    What's wrong? Need a bit more info on your problem...
     
  3. Offline

    Builder4Free

    It says the method doesn't exist.
     
  4. Offline

    Hoolean

    Works for me :( ..... Maybe try
    Code:java
    1. chest.getBlockInventory()
    ?
     
  5. Offline

    skore87

    If you use getBlockInventory you will only get the single block's inventory. So if you're after a doublechest, you'll get one half of it. And to get the inventory of the chest object, you need to use the import org.bukkit.block.Chest instead of the material one.
     
    Zidkon likes this.
  6. Offline

    Builder4Free

    Omg you're a life-saver.
     
  7. Offline

    skore87

Thread Status:
Not open for further replies.

Share This Page