1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Drop item from a chest

Discussion in 'Plugin Help' started by dadodasyra, May 5, 2020.

  1. dadodasyra

    dadodasyra Witch

    Messages:
    68
    GitHub:
    dadodasyra
    Hello everyone !

    I want drop all the items from a chest (getDrops return just the chest but not his content).
     
  2. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    PHP:
    use pocketmine\tile\Chest as TileChest;
    $pos = ....; //Position of chest

    $tile $pos->getLevel()->getTile($pos);
    if(
    $tile instanceof TileChest){
    $tile->getInventory()->dropContents($pos->getLevel(), $pos);
    }
     
    ethaniccc and HimbeersaftLP like this.
  3. dadodasyra

    dadodasyra Witch

    Messages:
    68
    GitHub:
    dadodasyra
    Thanks, how to close a thread ?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.