Dynamic runtime plugin and mod loader for Minecraft Fabric servers — no restart required.
PlugBox allows you to load, unload, and reload Fabric mods and custom plugins at runtime without restarting the Minecraft server. It features a built-in Mixin transformation pipeline with automatic compatibility detection, a ghost protection system for blocks, entities, and items, and a full server-side command suite.
- Dynamic Mod Loading — Drop a
.jarintoplugins/and load it with/plugbox load <file>. - Mixin Support — Automatically discovers and registers
mixins.jsonconfigs from Fabric mods. - Compatibility Detection — Three-level safety system:
FULL— Target classes not yet loaded; standard Mixin transformation.RETRANSFORM— Targets already loaded, but JVMInstrumentation.retransformClasses()can safely apply changes.RESTART_REQUIRED— Structural modifications detected orInstrumentationunavailable; mod is queued for next restart.
- Ghost System — When a mod is unloaded, its blocks, entities, and items are transparently replaced with ghost placeholders and fully restored on reload.
- Hot Reload —
/plugbox reload <id>and/plugbox reloadallfor rapid development. - File Watcher — Optional directory monitoring for automatic unload on file deletion.
- Client GUI — In-game plugin manager accessible from the Options screen.
- Network Sync — Connected players receive plugin-list updates and reconnection notifications.
Plugin JAR
│
▼
┌─────────────────┐
│ Mod Discovery │ ← fabric.mod.json + MANIFEST.MF parsing
└────────┬────────┘
│
▼
┌─────────────────┐
│ Mixin Discovery│ ← .mixins.json discovery + @Mixin target extraction (ASM)
└────────┬────────┘
│
▼
┌─────────────────┐
│ Compatibility │ ← TargetIndex + loaded-class check
│ Checker │
└────────┬────────┘
│
┌────┴────┐
│ │
Early Late
│ │
▼ ▼
Mixin Instrumentation
Pipeline + Retransform
│ │
└────┬────┘
▼
┌──────────┐
│ Activate │ ← onLoad → onEnable
└──────────┘
| Component | Responsibility |
|---|---|
InstrumentationAgent |
Acquires java.lang.instrument.Instrumentation via premain or dynamic attach |
LateMixinTransformer |
ClassFileTransformer that delegates retransform calls to the internal Mixin engine |
MixinConfigDiscovery |
Parses fabric.mod.json and .mixins.json; extracts @Mixin targets via ASM |
TargetIndex |
Maps mixin configs → target classes for fast lookup |
TransformationManager |
Orchestrates early/late transformation and compatibility reporting |
FabricClassPathInjector |
Injects mod JARs into the Fabric/Knot classpath so Mixin can resolve classes |
GhostBlockRegistry / GhostEntityRegistry / GhostItemRegistry |
Serializes, ghostifies, and resurrects mod content |
- Minecraft
1.21.4 - Fabric Loader
>= 0.16.0 - Fabric API any version
- Java
>= 21
Note: For
RETRANSFORM(late Mixin) support, the server must be started with the PlugBox agent:java -javaagent:plugbox.jar -jar fabric-server-launch.jarIf the agent is not attached, mods targeting already-loaded classes will be marked
RESTART_REQUIREDinstead of crashing.
- Build the mod with Gradle:
./gradlew build
- Copy
build/libs/plugbox-1.2.6.jarinto your server'smods/folder. - (Optional but recommended) Start the server with the agent flag for late-transformation support:
java -javaagent:mods/plugbox-1.2.6.jar -jar fabric-server-launch.jar
- The
plugins/directory will be created automatically on first run.
All commands require permission level 2 (OP).
| Command | Description |
|---|---|
/plugbox list |
List loaded plugins with status |
/plugbox load <file.jar> |
Load a plugin from the plugins/ directory |
/plugbox unload <id> |
Unload a plugin (ghostifies its content) |
/plugbox reload <id> |
Reload a single plugin |
/plugbox reloadall |
Reload all active plugins |
/plugbox info <id> |
Show detailed plugin metadata |
/plugbox install <path> |
Copy a JAR into plugins/ and load it |
Plugins can implement the com.example.plugbox.api.Plugin interface or ship a standard fabric.mod.json — PlugBox adapts Fabric mods automatically.
public interface Plugin {
String getId();
String getName();
String getVersion();
String[] getAuthors();
default String getDescription() { return ""; }
void onLoad(PluginContext context);
void onEnable(MinecraftServer server);
void onDisable(MinecraftServer server);
void onUnload();
default void onPlayerJoin(ServerPlayerEntity player) {}
default void onPlayerLeave(ServerPlayerEntity player) {}
}Each plugin receives a PluginContext with:
DynamicCommandRegistry— Register Brigadier commands at runtimeDynamicEventBus— Subscribe to Fabric eventsDynamicScheduler— Tick-based task schedulerPluginConfig— Per-plugin JSON configuration
When a mod is unloaded, PlugBox preserves its world state:
- Blocks → Replaced with indestructible Ghost Blocks; restored when the mod reloads.
- Entities → Serialized and removed; respawned on reload.
- Items → Replaced with Ghost Items in inventories and dropped items; restored on reload.
Ghost data is persisted in chunk NBT (PlugBoxBlockGhosts, PlugBoxEntityGhosts) and survives server restarts.
Global config is stored at plugbox.json in the server root:
{
"activePlugins": ["MyPlugin.jar", "AnotherMod.jar"]
}Active plugins are auto-loaded on server start.
- No bytecode rollback on unload. Disabling a plugin stops its lifecycle but does not revert JVM classes. The ghost system compensates by hiding mod content.
- Late Mixin requires the agent. Without
-javaagent, structural changes to already-loaded Minecraft classes cannot be applied dynamically. - Registry freeze. Mods that register blocks, items, or entities during
onInitialize()still require a full JVM restart because Minecraft registries are immutable after startup. PlugBox detects this and warns accordingly.