Skip to content

Instantly share code, notes, and snippets.

@Specnr
Created January 10, 2023 14:07
Show Gist options
  • Save Specnr/0f2632fbae4499793425e1c2ebec4059 to your computer and use it in GitHub Desktop.
Save Specnr/0f2632fbae4499793425e1c2ebec4059 to your computer and use it in GitHub Desktop.
DELETES all worlds called New World or Speedrun # in all instances AND wipes records folder
import shutil
import glob
import os
# Edit this
INST_FOLDER = "C:/MultiInstanceMC/MultiMC/instances"
RECORDS_FOLDER = "C:/Users/Spencer/speedrunigt/records"
with open("bop.log", "w") as log:
print("Deleting worlds...")
files = glob.glob(f'{INST_FOLDER}/*/.minecraft/saves/*')
for f in files:
if os.path.isdir(f) and ("New World" in f or "Speedrun #" in f or "Practice Seed" in f):
log.write("Deleting: " + f + "\n")
shutil.rmtree(f)
else:
log.write("Skipping: " + f + "\n")
print("Deleting records...")
files = glob.glob(f'{RECORDS_FOLDER}/*.json')
for f in files:
os.remove(f)
input("Bopping completed, press Enter to continue...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment