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

getTiles return an empty array

Comments in 'Plugin Development' started by Legoboy0215, Jan 1, 2016.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Title says it all. I loaded my level already. Code:
    PHP:
    $this->getServer()->loadLevel("hny");
    var_dump($this->getServer()->getLevelByName("hny")->getTiles()); //array(0)
    There are tiles in the world. I checked with my MCPE and even with code:

    PHP:
    public function onInteract(PlayerInteractEvent $e){
            
    var_dump($e->getBlock()); //Chest 'block'
            
    var_dump($t $e->getBlock()->getLevel()->getTile($e->getBlock())); //Returns a chest tile
    }
  2. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Last edited: Jan 1, 2016
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Legoboy0215 likes this.
  4. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    So...

    $level->getChunk(6 >> 4, -5 >> 4)->getTiles()

    I don't get what are chunks so... I can't understand anything, which results an unsolvable problem for me.

Share This Page

Advertisement