Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[NEW API] Fill a chest with random items | blocks.

Comments in 'Plugin Development' started by Killman2, Jul 11, 2014.

  1. Killman2
    Offline

    Killman2 Active Member Plugin Developer

    Joined:
    May 5, 2014
    Posts:
    81
    Plugins:
    1
    Minecraft User:
    Killman2
    Hi, I'm making a plugin, but got stucked with the chest fill.

    I just want the code where it fills the chest with random items and blocks. Someone can help?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Look at tile/Chest.php
    Andrey Nazarchuk, applqpak and iksaku like this.
  3. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    pocketmine\tile\Chest
    setItem ($index, Item $item)
    xionbig likes this.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Oh yeah I got the wrong one. I was in a hurry :oops:
    Chest instanceof InventoryHolder. $chest->getInventory(). Refer to BaseInventory.PHP afterwards.
    Andrey Nazarchuk and iksaku like this.
  5. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    What is the difference between that and getRealInventory?
  6. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    What is the difference between bumping a 1 year old thread and creating a new one?
    PEMapModder and Andrey Nazarchuk like this.
  7. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    well admins here dont like that.
  8. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Much less of a difference than purposefully not answering the question.
    PEMapModder likes this.
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Use getInventory(). getRealInventory() is some tricks with double chests, you don't need to care about it.
    Andrey Nazarchuk likes this.

Share This Page

Advertisement