MAKE A BACKUP FIRST PLEASE
hey came to say there is now a command for this, its
if you game crashes please run this command first.
/wgen autogen 0
then:
/db prune 16 drop confirm
TLDR: This command looks for chunks where the player has distroyed/added 16 blocks. then deletes the rest of the chunks. THIS DOES NOT DELETE THE SEED. Just regens ores and other structures.
this command looks for any location that has any blocks destroyed/placed from EVERYWHERE around the world. in this case it looks for 16 block changes. this means your base is safe and the chunk your base is located in is unchanged. if you want it to be more strict, use logic to determine how high you want this value, around 75 was a good value to keep my base save but kill everything else.