1) Learn how to delete something: http://php.net/manual/en/function.unlink.php 2) Learn how to get the directory path of the level: https://github.com/PocketMine/Pocke...pocketmine/level/format/LevelProvider.php#L66 And I'll let you figure out the rest.
If you bother to find the link for the unlink() function, why not bother to read the user-contributed comments as well? http://php.net/manual/en/function.unlink.php#109971 http://php.net/manual/en/function.unlink.php#87045 http://php.net/manual/en/function.rmdir.php http://php.net/manual/en/function.rmdir.php#98622 (Summary: You cannot use unlink() or rmdir() to delete a directory that is not empty!) Or if you are using a private plugin that is only expected to be run on Linux or OS X, you can simply: PHP: exec("rm -r " . escapeshellarg(realpath($this->getServer()->getDataPath() . "worlds/" . $name)));