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

help about item drop

Discussion in 'Help' started by unknownmember, Dec 2, 2020.

  1. unknownmember

    unknownmember Creeper

    Messages:
    3
    Code:
    $level = $this->main->getServer()->getLevelByName("bedwars");
    $level->dropItem(new Vector3(96,66,258), Item::get(265,0,4));
        $level->dropItem(new Vector3(250,66,254), Item::get(265,0,4));
    
    error: "Call to a member function dropItem() on null" (EXCEPTION) in "plugins/bedwars.phar/src/euto3rr/Task/BaseIngotGenerator" at line 28
     
  2. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    PHP:
    $levelName "bedwars";
    $server $this->main->getServer();
    if(
    $server->isLevelGenerated($levelName)){
    if(!
    $server->isLevelLoaded($levelName)){
       
    $server->loadLevel($levelName);
    }
    $level $server->getLevelByName($levelName);
    $level->dropItem(new Vector3(96,66,258), Item::get(265,0,4));
       
    $level->dropItem(new Vector3(250,66,254), Item::get(265,0,4));
    }
     
    Primus likes this.
  3. unknownmember

    unknownmember Creeper

    Messages:
    3
    oh thank you so much. i forgot that i didnt load the world
     
  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.