WorldEdit and Regen command or alternative

So I had recently started up a new server for a handful of friends and I. One of the primary mechanics changes we made is a modified hardcore mode with multiple lives to make it a little more multiplayer friendly. When people lose these lives they can come back but they lose their entire base.

This latter bit was implemented as I had prior experience with WorldEdit and the handy //regen command. However since moving to PaperMC from Spigot (for performance reasons and I, personally, intend to go heavy into redstone and hopper contraptions) I found it is not working as intended.

Upon further research it seems to be a bit muddy exactly where the root cause for this is so would be interested if anyone else can give me any insight on this or possible an alternative way of accomplishing regeneration of a specified region.

So far the only potential alternative I’ve been able to find (still have to test) is fire up a new server with the same world seed, do a WorldEdit snapshot, then bring that over and restore the chunks from the backup which would be untouched. This can be done, but a bit unwieldy and likely requires some interruption of the server any time a regen needs done.

version? “not working as intended”?

Sorry, probably should have explained a bit better. Basically through normal WorldEdit operation, I can use the wand tool (Wooden Axe) to select an area and simply run //regen and it’ll regen that area. Past versions of Minecraft I have had no problems with this working and doing as you’d expect: Return said region to the way it was as a brand new world. However in PaperMC I get this on the console and nothing changes in world despite chat saying ‘Region Regenerated.’

[18:43:28] [Server thread/WARN]: Chunk generation via Bukkit raised an error
java.lang.UnsupportedOperationException: Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)

Version: git-Paper-214 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)

Spigot removed the ability to regenerate chunks in 1.14+, the chunk system in 1.14 makes restoring chunks a lot harder as you can’t unload a chunk so easily; I’ve considered looking into restoring this functionality for unloaded chunks, but, it’s entirely what people are after and would only cover a marginal percentage of use cases of that method, so not really a high priority

Worlededit does have a delchunk command, doesn’t give you the block level of control needed, but should have the same effect, I have no idea if this works for loaded chunks or not, I’ll have to try and find the time/energy/health to look into that

Got it. I wasn’t sure exactly the root cause and if there was a resolution so good to know!

I did give the alternative recommendation of utilising WorldEdit’s snapshot function with a clean world as a backup and the /restore command. It seemed to work surprisingly well and not much different than //regen. Immediate results and just a restore of the selected area and no need to restart the server. So I’ll probably stick with that for the time being. Only catch is I will periodically have to update the backup as we expand into new areas. Not a big concern.

//regen works in newer releases of WorldEdit. We’ve added a workaround that allows it to work again.

1 Like

its not working for me now
(1.16.3 server)