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

Chest help.

Comments in 'Plugin Development' started by xFlare, Mar 21, 2015.

  1. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    Trying to get chest to work..

    It seems like this code is not picking up chests for some reason..

    Help?
    PHP:
                        foreach($this->getServer()->getLevels()->getTiles() as $tile){
                            if(
    $tile instanceof Chest){
                                
    $id 364;
                                
    $damage 0;
                                
    $count 1;
                                
    $item Item::get($id$damage$count);
                                if(
    $tile->isPaired()){
                                  
    $inv $tile->getInventory();
                                }else{
                                  
    $inv $tile->getRealInventory();
                                }
                                
    $inv->addItem($item);
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Make sure you used the correct Chest, the tile not the block.
    Andrey Nazarchuk likes this.

Share This Page

Advertisement