------------------------Unloading and Deleting a world completely during a running game---------------------- I would like to unload and delete a world while the game is running. I want it to fully delete the world, the whole world folder. This is because the mini-game I'm making deletes and re-loads the world. Anybody know how to go about this? I have Google'd a lot about this but I just can't find the write answer I need! I need a code that can do both while the game is running. Help anybody?
Here you are. As far as I know, this method works. I haven't tested it in a while though... Code:java public void resetmap(World w, Player player) { for (Player p : w.getPlayers()) {p.kickPlayer(player.getName()+ " has deleted the world you are in!");} if (Bukkit.unloadWorld(w.getName(), true)) {System.out.println("Unloaded world");} else {System.err.println("Couldn't unload world");}if (delete(new File(w.getName()))) {System.out.println("Deleted world!");} else {player.sendMessage(ChatColor.DARK_RED+ "Unable to delete your world!");System.err.println("Couldn't delete world");}} Hope this works
Meh as far as I know I used this on one of my plugins, I didn't even make this. It worked so that was all that mattered have you even tested this?