A runtime patching framework (Java Agent) for Project Zomboid based on Sponge Mixin. It modifies game client code at runtime through -javaagent injection, without modifying game files or depending on any mod loader.
- Bytecode-level runtime injection, zero modification to game files
- Declarative patches written with Sponge Mixin
- MixinExtras integrated
| Item | Requirement |
|---|---|
| JDK | 21+ |
| Project Zomboid | Official client (you must provide your own projectzomboid.jar) |
-
Copy
projectzomboid.jarfrom your game directory into thelibs/folder. It is only used at compile time to resolve game classes, so make sure its version matches the game you intend to patch. -
Build:
./gradlew shadowJar
-
The output JAR is at
build/libs/ProjectZomboidMixin-1.0.jar.
Inject the agent through the Launch Options in the Steam client:
-
Right-click Project Zomboid in your Steam Library and select Properties.
-
Open the General tab and click Launch Options.
-
Add the full path to the agent JAR, e.g.:
-javaagent="C:\path\to\ProjectZomboidMixin-1.0.jar" -
Launch the game. The console prints
[AgentJar] Mixin loaded successfully!when injection succeeds, and[Agent Diagnostics] >>> Mixin Applied !!!each time a target class is successfully patched.
src/main/java/ink/szd/pz_optimize_framework/
├── AgentMain.java # Agent entry: initializes Mixin and registers the transformer
├── bootstrap/ # Mixin service and transformer adaptation layer
│ ├── PZMixinService.java # Custom IMixinService adapted to game ClassLoader
│ ├── PZMixinServiceBootstrap.java
│ ├── PZGlobalPropertyService.java
│ ├── PZMixinTransformer.java
│ └── PZClassTransformer.java # Intercepts zombie/* classes and runs Mixin transformation
└── mixins/
└── SleepOptionMixin.java # Sample patch: sleep retry cooldown 1h -> 10min
Mixin declarations live in src/main/resources/mixins.pz.json. When adding a patch class, register its simple class name in the mixins array.