everything works fine except for the setBlock()'s, here is my code: PHP: public function generateIsland(Player $player) { $name = $player->getName(); $this->getServer()->loadLevel($name); if($this->getServer()->getLevelByName($name) instanceof Level) { $player->sendMessage(TF::BOLD . TF::GRAY . "[" . TF::GOLD . "ML" . TF::WHITE . "BE" . TF::GRAY . "]" . TF::RESET . TF::RED . " You already made an Island!"); return; } $this->getServer()->generateLevel($name, null, "pocketmine\level\generator\Flat", ["preset" => "2;0;1"]); $level = $this->getServer()->getLevelByName($name); $grass = Block::get(2); $dirt = Block::get(3); $stone = Block::get(1); for($x = 251; $x <= 261; $x++) { $z = 251; while($z <= 261) { $level->setBlock(new Vector3($x, 60, $z), $grass); $level->setBlock(new Vector3($x, 59, $z), $dirt); $level->setBlock(new Vector3($x, 58, $z), $dirt); $level->setBlock(new Vector3($x, 58, $z), $dirt); $level->setBlock(new Vector3($x, 57, $z), $stone); $z++; } } $player->sendMessage(TF::BOLD . TF::GRAY . "[" . TF::GOLD . "ML" . TF::WHITE . "BE" . TF::GRAY . "]" . TF::RESET . " Your island has been made!");}
now im having errors: Code: [Server thread/CRITICAL]: Error: "Call to a member function loadChunk() on null" (EXCEPTION) in "plugins/MLBESkyblock/src/mlbe/skyblock/Core" at line 49 I just put the code you gave me here: PHP: for($x = 251; $x <= 261; $x++) { $z = 251; while($z <= 261) { $level->loadChunk($x, $z); $level->setBlock(new Vector3($x, 60, $z), $grass); $level->setBlock(new Vector3($x, 59, $z), $dirt); $level->setBlock(new Vector3($x, 58, $z), $dirt); $level->setBlock(new Vector3($x, 58, $z), $dirt); $level->setBlock(new Vector3($x, 57, $z), $stone); $z++; }}