Hello, I know how to create regions with the worldguard api, but what I need is that the information of the region (and the region itself) be in a configuration file of my complement and not in that of worldguard. Does anyone know any method that helps me? Thanks in advance
If you want to grab the WorldGuard regions at a certain location or name there are loads of examples on the WorldGuard API Wiki - > https://worldguard.enginehub.org/en/latest/developer/regions/spatial-queries/ As for obtaining the information of a non-specific region, you'd loop through a ApplicableRegionSet, obtain the region and then you can get values from that region. If you're trying to get a specific region that you know exists you can either grab the region using a new WorldEdit Location.
Code (Java): Location loc = new Location(world, x, y, z); RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); RegionQuery query = container.createQuery(); ApplicableRegionSet regionSet = query.getApplicableRegions(loc); for (Region region : regionSet) { // Do something }
Sorry but I do not know if I do not understand or you do not understand me, what I need is that when creating a region with that command a region is created but instead of being stored in the worldguard regions file I want it to be stored in a custom file of my plugin
You're still going to need to grab the WorldGuard region, then transfer over the values to your own custom file from each value of the Region object.
I understand that, but then how do I make my complement or recognize the values in the configuration file as regions? Also, what does that location mean from the example you sent me?