MineGui is a Fabric client library that embeds Dear ImGui into Minecraft 1.21.4, giving mod developers an immediate-mode toolset for in-game overlays, inspectors, and interactive editors without leaving the client.
- Immediate-first runtime that stays thin so you can script raw ImGui every frame.
- Utility-driven helpers for cursor policies, constraint math, textures, and fonts without dictating component hierarchies.
- Stable, lightweight lifecycle that prioritizes predictable hooks and minimal overhead in production builds.
You can find the developer documentation HERE.
MineGui bundles the full imgui-java runtime and layers tooling around it so you can stay inside Dear ImGui while building Fabric mods:
- Full Dear ImGui API — Views implement
renderView()and call native widgets every frame while MineGui drives the render loop. - View lifecycle & persistence —
ViewSaveManagertracks visibility, persists window state, and lets you plug in custom adapters per namespace. - Themes, fonts & styles —
StyleManager,MGStyleDescriptor, andMGFontLibrarymanage transient style deltas, named themes, and registered font atlases. - Layouts & sizing helpers —
MineGuiContext.layout()offers stack/grid builders whileVStack/HStackkeep constraint math and spacing utilities immediate-mode friendly. - Textures & drawing utilities —
ImGuiImageUtilsstreams Minecraft textures into ImGui draw lists, handles UV transforms, and keeps caches in sync with the client renderer. - Namespaces, config & commands —
MineGuiInitializationOptionswires global config, cursor policies, and persistence per namespace, while commands like/minegui reloadrefresh live styles during development.
- Fabric Loader 1.21.4 with Yarn mappings
1.21.4+build.8
Set minegui_version=0.0.3-0.119.4+1.21.4+build.8 in your gradle.properties, then follow the steps below. Check GitHub Packages for the latest published versions.
- Add the GitHub Packages repository
In your rootbuild.gradle(orsettings.gradleif you centralize repositories), include:
repositories {
maven {
url = uri("https://maven.pkg.github.com/trethore/MineGui")
credentials {
username = findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}Recommended: store credentials in ~/.gradle/gradle.properties.
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_PERSONAL_ACCESS_TOKEN
Generate a personal access token with read:packages scope.
- Add the dependency
Declare MineGui as a mod dependency alongside Fabric loader and Fabric API:
dependencies {
modImplementation include("tytoo.minegui:minegui:${project.minegui_version}")
sourceDeps "tytoo.minegui:minegui:${project.minegui_version}:sources@jar"
}Alternatively, add MineGui through Maven:
<dependency>
<groupId>tytoo.minegui</groupId>
<artifactId>minegui</artifactId>
<version>0.0.3-0.119.4+1.21.4+build.8</version>
</dependency>- Initialize MineGui in your client entrypoint
MineGui does not auto-register a runtime initializer. CallMineGuiCore.init(...)before you register any views:
import net.fabricmc.api.ClientModInitializer;
import tytoo.minegui.MineGuiCore;
import tytoo.minegui.MineGuiInitializationOptions;
import tytoo.minegui.runtime.MineGuiContext;
public final class MyModClient implements ClientModInitializer {
private MineGuiContext mineGui;
@Override
public void onInitializeClient() {
mineGui = MineGuiCore.init(MineGuiInitializationOptions.defaults("your_namespace"));
// mineGui.layout() exposes the new layout DSL; mineGui.ui() returns the namespace UI manager.
}
}- Run in development
Use the bundled Gradle tasks while building MineGui or integrating it into another mod:
./gradlew build # assemble artifacts and run checks
./gradlew runDebugClient # develop MineGui with debug overlays and commands enabled
# or, when testing MineGui as a dependency in another mod:
./gradlew runClientIn-game debug commands such as /minegui reload and /minegui export style force are available only in debug runs.
Contributions are welcome!
-
Report bugs or request features in the issue tracker.
-
Submit improvements and fixes as pull requests.
-
Before contributing, make sure you can build and test the project locally:
./gradlew build # assemble and run checks ./gradlew runDebugClient # develop MineGui with debug commands enabled # or, when testing MineGui as a dependency in another mod: ./gradlew runClient
Please follow best practices (clean code, descriptive commits, small PRs).
MineGui is released under the MIT License.
