WorldEdit Save and load selection

Discussion in 'Spigot Plugin Development' started by JosephGP, Jun 21, 2015.

  1. Hey guys i was wondering how to use world edit api for saving and loading specific arena
    i searched to long but i didn't found any thing :)
     
  2. Check the schematic part in the source.
     
  3. ok thanks
     
  4. Sorry in advance for the small amount of spoon feeding. But actually explaining it without giving code would be too hard.

    First you load the worldedit plugin:
    Code (Text):
    WorldEditPlugin worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit");

    After that you do this to get the selection:
    Code (Text):
    Selection selection = worldedit.getSelection(player);

    Then it's just a simple getMinimumPoint, getMaximumPoint to get the locations:
    Code (Text):
    selection.getMinimumPoint();
    selection.getMaximumPoint();

    I use this for my KoTH too, very easy ^^
     
  5. thanks :p