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

Solved getChunk() on null

Comments in 'Plugin Development' started by Praxthisnovcht, Oct 16, 2015.

  1. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    Code:
    Fatal error: Call to a member function getChunk() on null in C:\Users\Alex\Desktop\PocketMine-MP\plugins\Skywars-Pro_v1.0.0\src\Skywars\Main.php on line 1022
    
    Call Stack:
    
    Line Code
    PHP:
                                $this->getServer()->getLevelByName($world)->getChunk($this->getServer()->getLevelByName($world)->getSpawnLocation()->getX(), $this->getServer()->getLevelByName($world)->getSpawnLocation()->getZ());
  2. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    You did not check is the Chunk you used and wanted is loaded.
  3. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    weird
  4. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    use
    PHP:
    $world->loadChunk(xz);
    ;)
  5. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    same probleme :p
  6. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Maybe the world you want isn't loaded.

Share This Page

Advertisement