Skip to content

Repository files navigation

CleanMCMod

CleanMCMod

🌍 🇬🇧 English · 🇩🇪 Deutsch · 🇪🇸 Español · 🇫🇷 Français · 🇮🇹 Italiano · 🇯🇵 日本語 · 🇰🇷 한국어 · 🇳🇱 Nederlands · 🇵🇱 Polski · 🇧🇷 Português (Brasil) · 🇷🇺 Русский · 🇹🇷 Türkçe · 🇺🇦 Українська · 🇨🇳 简体中文 · 🇹🇼 繁體中文

Client-side cache cleaner for Minecraft, the mods you have installed and the resource packs they use. Stale caches are what make the game render wrong: purple-and-black missing models, textures that never refresh, broken resource packs, and deleting them is usually the only fix that helps. CleanMCMod does that from one screen, shows what it would remove before removing anything, and can update your mods from Modrinth on request.

Fabric Loader, client only: the jar declares environment: client and never runs on a dedicated server.

What it cleans

Target Regenerated by
logs/ writing a new log
crash-reports/ the next crash
debug dumps the game
server resource-pack cache re-downloaded from the server
Fabric remapped-jar cache Loom/Fabric on next launch
Mixin debug output Mixin, if enabled again
asset indexes / asset objects downloaded from Mojang, off by default
config/<mod>/**/cache* the mod that created it (off by default per folder)

Every target is measured before it is deleted. Directories are never removed themselves, only their files, symlinks are never followed, and saves/, mods/*.jar, resourcepacks/, shaderpacks/, screenshots/ and top-level config/*.json are never touched.

In game

  • F7 opens the CleanMCMod screen, and the title screen gets a CleanMCMod... button, so it is reachable before a world is loaded.
  • /cleanmcmod scan, /cleanmcmod clean and /cleanmcmod screen do the same work from chat.
  • The main screen lists each cache with its size, a Dry run line that says nothing will be deleted while that setting is on, and buttons for Clean now, Rescan, Settings... and Update mods....

Eight settings, saved to config/cleanmcmod.json the moment you toggle them: game logs, crash reports, debug dumps, server resource packs, loader and mod caches, the deep asset cache, mod-cache auto-detection, and dry run.

Updating mods

Update mods... scans mods/, asks Modrinth for a newer build of each jar that matches your game version and loader, and lists them. Nothing is installed until you press Install selected or Install all and confirm. A download is verified against the SHA-1 Modrinth publishes, the old jar is moved aside, the new one is moved in, and the old jar is restored if anything fails. CleanMCMod never updates its own jar while it is loaded.

Offline, unknown project, no matching version, unreadable jar, hash mismatch: each leaves mods/ exactly as it was and shows one readable message.

Supported versions

One source tree covers 1.21.8, 1.21.9, 1.21.10 and 1.21.11. Pass -Pmc=<version> and the matching Yarn, Fabric API and Java level are selected from the support matrix in build.gradle; all four compile and are tested in CI, one workflow per version.

./gradlew clean build -Pmc=1.21.11   # build/libs/cleanmcmod-<version>+1.21.11.jar

26.1 / 26.2 / 26.3 are supported from their own branches, 26.1, 26.2 and 26.3: those releases ship unobfuscated, with no Yarn mappings, so they build with Loom's non-remapping plugin against the official class names on Java 25 and cannot share this Yarn/JDK 21 tree.

Optional Mod Menu

If Mod Menu is installed, CleanMCMod appears in its list and its button opens the main CleanMCMod screen, where Update mods... is one click away. Mod Menu is compiled against with modCompileOnly and declared as suggests, never depends: without it the game boots normally and no Mod Menu class is loaded.

Languages

en_us is canonical. Shipped translations: German, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Brazilian Portuguese, Russian, Turkish, Ukrainian, Simplified Chinese, Traditional Chinese. Every file must carry the same key set as en_us.json; AGENTS.md §6 has the parity check.

Every language also has a page under docs/ with the same instructions for a player, and each page carries a switcher that jumps to any other language. Both the mod's texts and those pages were translated with the help of AI: a wording can still be wrong, and the English text is the reference when they disagree.

Building from source

The wrapper is checked in, so no Gradle installation is required. Two JDKs are needed: Java 25 runs Gradle and Loom (Loom 1.19.3 refuses to run on 21), and a Java 21 must also be installed because the build pins a Java 21 toolchain.

export JAVA_HOME=/path/to/jdk-25
./gradlew clean build              # 50 unit tests + jar in build/libs/
./gradlew runClient                # dev client, game directory ./run

# if Gradle cannot find the Java 21 toolchain:
./gradlew clean build -Porg.gradle.java.installations.paths=/path/to/jdk-21

The version comes from version.txt (single source of truth); the artifact is cleanmcmod-<version>+<minecraft_version>.jar.

Not in this mod

No hiding of installed mods from a server, no anti-cheat or mod-detection evasion, and no pretending that a server resource pack was accepted. Those break the Modrinth content rules and server terms of service, so they are deliberately absent and will stay absent.

Tested configuration

The author tests only the latest Minecraft version (26.3 at the time of writing). The other branches are provided as is: they compile and their unit tests pass, but no in-game guarantee is made for them.

Publishing a release

Each branch builds one Minecraft version: ./gradlew clean build in a branch produces build/libs/cleanmcmod-<mod version>+<minecraft version>.jar, which is the file uploaded to Modrinth for that game version (loader: Fabric, environment: client). The listing icon is logo.png at the repository root; the jar ships the same artwork as assets/cleanmcmod/icon.png.

Credits

CleanMCMod is made by PiBOH.

Its update list started from ModMenuUpdater by UDPSendToFailed, and its settings use the layout of Sodium and Reese's Sodium Options.

Other Minecraft mods by the same author: Jarock and DedicatedPower, which PiBOH maintains and whose original author is Server OS.

License

MIT, see LICENSE.