Note that the server.properties auto-save attribute also affects the saving of player data like coords, inventories.
it is better to use the method below, or it may just be enough to Unload-Load the world that does not save PHP: public function unload(Level $w, $name) { $path = $this->getConfig()->get("WorldsFilePath"); $this->getServer()->unloadLevel($w); $files = glob("../$path/worlds/$name/region"); // get all file names foreach ($files as $file) { // iterate files if (is_file($file)) unlink($file); // delete file } $this->recurse_copy("../$path/copys/$name", "../$path/worlds/$name/region"); $this->getServer()->getScheduler()->scheduleDelayedTask(new JTask([$this, "load"], [$name]), 1 * 20); return true; } public function getAllWorlds() { $resule = []; foreach (scandir($this->getDataFolder()) as $file) { if (substr($file, -3) === "yml") { $data = @yaml_parse(Config::fixYAMLIndexes(@file_get_contents($this->getDataFolder() . "data/" . $file))); if (isset($data['ArenaWorld'])) { $resule[] = $data; } } } return $resule; } public function recurse_copy($src, $dst) { $dir = opendir($src); @mkdir($dst); while (false !== ($file = readdir($dir))) { if (($file != '.') && ($file != '..')) { if (is_dir($src . '/' . $file)) { recurse_copy($src . '/' . $file, $dst . '/' . $file); } else { copy($src . '/' . $file, $dst . '/' . $file); } } } closedir($dir); } //Utils public function load($w) { $this->getServer()->loadLevel($w); return true; }