I'm guessing you mean "regeneration" as in "repopulating" (aka "repop").. (P.S. I haven't tested the code, but this should work). PHP: /** @var Vector3 $initial *//** @var Vector3 $final *//** @var Level $level */$x = [$initial->x >> 4, $final->x >> 4];$z = [$initial->z >> 4, $final->z >> 4];for($x = min($x); $x <= max($x); ++$x){ for($z = min($z); $z <= max($z); ++$z){ if(($chunk = $level->getChunk($x, $z)) instanceof \pocketmine\level\format\Chunk) $chunk->setGenerated(false); }}
dont work( [10:38:05] [Server thread/CRITICAL]: Error: "Call to a member function getChunk() on unknown" (EXCEPTION) in "/WorldEditor_v1/src/plugin/WorldEditor/WorldEditorMainFolder/Builder" at line 209 function regen(&$session, &$output) { $pos1 = $selection[0]; $pos2 = $selection[1]; $minX = min($pos1[0], $pos2[0]); $maxX = max($pos1[0], $pos2[0]); $minY = min($pos1[1], $pos2[1]); $maxY = max($pos1[1], $pos2[1]); $minZ = min($pos1[2], $pos2[2]); $maxZ = max($pos1[2], $pos2[2]); /** @var Vector3 $initial */ /** @var Vector3 $final */ /** @var Level $level */ $x = [$initial->x >> 4, $final->x >> 4]; $z = [$initial->z >> 4, $final->z >> 4]; for ($x = $minX; $x <= $maxX; ++$x) { for ($y = $minY; $y <= $maxY; ++$y) { for ($z = $minZ; $z <= $maxZ; ++$z) { $level->getChunk($x, $z)->setGenerated(false); $output .= "regen region"; } } } }