Filling Chest Help

Discussion in 'Plugin Development' started by dlange, Feb 12, 2015.

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


    Chest Filling Help
    I'm making a plugin and part of it needs the chests to be filled in the arena. I can't seem to figure out how to go about doing this. If someone can help it would be greatly appreciated. :)

    - dlange
  2. Offline


    Iterate on all the blocks within a cuboid range, if the block is a chest then fill it with items. If not continue with your iteration.
  3. Offline


    In addition to what aaomidi said:

    How are you storing the two boundaries of the arena? In two separate Location instances or one cuboid (a custom class) instance?

    Also, if you want a small Cuboid class:

    You can get all the blocks by doing:
    for (Block block : cuboid) {
    Or alternatively, List<Block> blocks = cuboid.getBlocks();
  4. @dlange I was wondering the same thing too but I want to fill chests inside a WorldEdit Selection. Anyone can help me with that?
  5. Offline


    Thanks a lot, i will try :)
  6. Offline


    What I do is that I fill the chest when it opens. That way, it's a lot less laggy.
  7. Offline


    That's very clever, I'd recommend that to be honest instead of my suggestion.
    ReadySetPawn likes this.
  8. Offline

    bwfcwalshy Retired Staff

Thread Status:
Not open for further replies.

Share This Page