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

problem with getting chests (loading tiles)

Comments in 'Plugin Development' started by cake23, Mar 16, 2016.

  1. cake23
    Offline

    cake23 Active Member

    Joined:
    Aug 10, 2015
    Posts:
    124
    Minecraft User:
    TheEnd
    If I fill chests with Items, it only fill chest in the near of a player.
    Also if I load the Chunk before with
    PHP:
    $this->getServer()->getLevelByName($level)->loadChunk($x$z);

    PHP:
     $tilesin $this->getServer()->getLevelByName($level)->getTiles();
    foreach (
    $tilesin as $tile){
      if (
    $tile instanceof \pocketmine\tile\Chest){
      
    $tile->getRealInventory()->clearAll();
      
    $tile->getRealInventory()->addItem($Item);
      }
      }
    count($tilesin) is 20 instead of 100.

    So I have the problem, that I dont get with getTiles() all Tiles(Chests) of a Level.
    Can anyone help me?
    Thanks! :D

Share This Page

Advertisement