WorldGuard copy region from one world to another

Discussion in 'Plugin Development' started by Xp10d3, Apr 19, 2021.

  1. Offline

    Xp10d3

    I'm attempting to copy a region from on world (ex. lets say, TreeHouseDummy to TreeHouse) but am unfamiliar with WorldGuard and had some issues with player not being able to break blocks in the correct area outside of the region. Is there a better way to do this?
    Code:java
    1.  
    2. public static void regionManagement(World world, String regionId, String currentWorld) {
    3. RegionContainer container = core.getWorldGuard().getRegionContainer();
    4. RegionManager regionWorld = container.get(world);
    5. ProtectedRegion regionWorldID = regionWorld.getRegion(regionId);
    6. RegionManager targetWorld = container.get(Bukkit.getWorld(currentWorld));
    7. targetWorld.addRegion(regionWorldID);
    8. }
    9.  
     

Share This Page