1.15.2 Bedwars Map Reset

Discussion in 'Spigot Plugin Development' started by Minimigamer, Jan 28, 2020.

  1. Hey guys, im lokking for a way to reset a map for my bedwars plugin i havent coded anything yet.
    i found the was to copy the World and after the game delete the used one and copy the backup.
    but with this method you habe to restart the Server.
    im trying to do it on one Server with a few maps so no server restart pssible.

    another method is to load a schematic but i habe no Idea about how to do this, is this method working?
    do you guys have some Links which explains this method ?
  2. If you want to use a schematic, you have two options. Either you use the WorldEditAPI (unfortunately I don't have a tutorial for that at hand), or you write your own schematic-parser and use either the .schem format or the .nbt format. I think using StructureBlocks, Bukkit also provides a basic API to do what you want.
  3. I wouldn't recommand pasting schematics or something similar.
    It's pretty "laggy" and I think you can't reset entities properly.
    Restart your server, it is worth it, delete the world, copy the backup world folder and there you go.

    If you use a cloud system, the server will be restarted nevertheless.

    But if you want to use schematics, use a loop and go through all blocks.
  4. If you're okay restarting I honestly just would set auto save to the world as false then make a command to save the world manually and once the map is done you save it so any changes during the game will not affect the default maps setup and once restarted it'll convert back to how it started.