What is the code to generate an island like chunk? i only know how to create a box Code: $chunk = $this->level->getChunk($chunkX, $chunkZ); $chunk->setGenerated(); if ($chunkX % 20 == 0 && $chunkZ % 20 == 0) { for ($x = 0; $x < 16; $x++) { for ($z = 0; $z < 16; $z++) { $chunk->setBlock($x, 0, $z, Block::BEDROCK); for ($y = 1; $y <= 3; $y++) { $chunk->setBlock($x, $y, $z, Block::STONE); } $chunk->setBlock($x, 4, $z, Block::DIRT); $chunk->setBlock($x, 5, $z, Block::GRASS); } Tree::growTree($this->level, $chunkX * 16 + 8, 6, $chunkZ * 16 + 8, $this->random, 0); } $chunk->setX($chunkX); $chunk->setZ($chunkZ); $this->level->setChunk($chunkX, $chunkZ, $chunk); }
I assume you want to create an island that looks like this: Code: %%%%% %%%%%%%%% %%%%%%%%%%% %%%%%%%%% % %%%%%%%%%%% +-+ | | | | | | | | +-+---------------------+-+-----+--+ | | +--+-----------------------+--+ | | | | +---+---------------+---+ | | | | +--+---------+--+ | | +-+-----+-+ | | +-----+ +-+ If so, you can make a loop that decreases the size of the square by two on every run and changes the x, y and z start coordinates to fit the new size.