ModsFinder

Delete Empty Folders On Game Close

by SmilerRyan

Delete Empty Folders On Game Close removes empty folders in the Minecraft instance when the game shuts down, with an optional text file for paths to keep.

FabricClient-side onlyAll rights reserved1.14 – 1.21.11

What it does

When the game closes, the mod searches the instance folder for folders that contain no files and deletes them. Folders are found through every level of nesting, so an empty folder inside another empty folder is removed as well. The search only covers the current Minecraft instance's folder, so files outside it are never touched.

Some folders should stay even when empty, and for that the mod reads an optional exclusions file named cleanup_exclusions.txt in the Minecraft folder. Each line holds one path to skip, relative to the main folder, for example saves/saves. Repeat the line for every folder that should be spared. Without the file, the mod uses no exclusions and deletes every empty folder it finds. Players who want to stop the cleanup can disable or remove the mod.

The mod is client-side only, so a server does not need it and players join without installing it. It is built for Fabric and published for 1.14 – 1.21.11 with 43 release versions; the latest Fabric file is 2 for 1.21.11, dated 2026-06-13. The code is All rights reserved and not open source.

Key features

  1. Automatic cleanup on close

    When the game exits, empty folders in the instance are removed without any action from the player.

  2. Nested folder handling

    Folders that become empty only after their subfolders are removed are cleaned up in the same pass.

  3. Optional exclusions file

    A plain text file in the Minecraft folder lists paths that must not be deleted, one per line.

  4. Instance-only scope

    Deletion is limited to the current Minecraft instance folder, so content outside it stays in place.

Compatibility

Latest build for each game version and loader.

1.21.x12 of 12 versions with builds
1.21.112
1.21.102
1.21.92
1.21.82
1.21.72
1.21.62
1.21.52
1.21.42
1.21.32
1.21.22
1.21.12
1.212
1.20.x7 of 7 versions with builds
1.19.x5 of 5 versions with builds
1.18.x3 of 3 versions with builds
1.17.x2 of 2 versions with builds
1.16.x6 of 6 versions with builds
1.15.x3 of 3 versions with builds
1.14.x5 of 5 versions with builds
ReleaseBetaAlphaNot available

Only full game releases are shown. This mod publishes no snapshot builds.

Questions

Does Delete Empty Folders On Game Close need Fabric API?

No required dependency is listed for Fabric.

Does a server need this mod?

No. The mod is client-side only, so only the player's client runs it and servers can run without it.

How does the mod know which folders to keep?

Create a file named cleanup_exclusions.txt in the Minecraft folder and list one path per line, such as saves/saves. Without that file nothing is excluded.

Which game versions does the mod support?

Files are published for 43 release versions 1.14 – 1.21.11, and the latest Fabric file is for 1.21.11.

In the catalog

Delete Empty Folders On Game Close is one of 7,555 Cursed mods on ModsFinder, and one of 4,235 Cursed mods for Fabric. 19,862 mods support Minecraft 1.21.11.

More from SmilerRyan

All projects

Similar mods

What the author says

When the game closes, it searches for and deletes any empty folders. It does not delete empty files or anything outside of the current minecraft instances folder.
SmilerRyan, on the Modrinth page

Official listing

Owner
SmilerRyan
Published
2026-06-13
Updated on Modrinth
2026-06-13
Facts verified
2026-10-15

Tags