Home›Java›Mods›Dynamic Patcher
Dynamic Patcher
ModsJava

Dynamic Patcher

Java mod listed for Minecraft 26.x. Downloads from the MC Java Mods app on Android.

by qendolin · on Modrinth

⬇ Download on Modrinth

DynPatcher

Dynamically compile and load Mixin patches from source at runtime.

User Guide

Overview

DynPatcher allows you to add or modify Fabric Mixins without recompiling the mod JAR. Source .java files placed in the patches directory are compiled at startup using an embedded Java compiler and registered with Mixin.

File Structure

When the game launches with DynPatcher installed, the following directory structure is created in your .minecraft/config/dynpatcher/ folder:

Disabling Patches

To disable specific patches without removing the source files, list their relative paths under disabledPatches in config.json:

{
  "disabledPatches": [
    "example/MyMixin.java"
  ]
}

Paths are relative to the config/dynpatcher/patches/ directory.

Source File Handling

Caching

Compiled bytecode is cached in config/dynpatcher/.cache/. A source file is recompiled only if its content or timestamp changes, or if the installed mod version changes.

Developer Documentation

Architecture

DynPatcher executes during early startup as an IMixinConfigPlugin:

  1. Configuration & Discovery: Reads config.json and scans config/dynpatcher/patches/ for .java files, filtering out disabled patches.
  2. Cache Resolution: Validates cached .class files against index.json using timestamp and SHA-256 content hashes.
  3. Preprocessing: Reads stale or uncached sources, applying syntax adjustments (default package injection and public modifier stripping) in memory.
  4. Runtime Compilation: Compiles source objects in memory using the Eclipse Compiler for Java (ECJ).
  5. Bytecode Inspection & Patching: Uses ASM to inspect compiled classes for net.fabricmc.api.Environment annotations (filtering out Mixins incompatible with the current environment) and appends remap = false to Mixin annotations that do not specify a remapping preference.
  6. Mixin Registration: Dynamically generates per-package Mixin JSON configurations and registers them via Mixins.addConfiguration.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

File checked by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more