Xi's Multiversion UI Lib docs

Build mod menus once with plain Java widgets and run them on Minecraft 1.7.10 to 26.3 across every major loader.

Last updated

On this page

Xi's Multiversion UI Lib (mod id xis_mvui) lets a mod describe its menus with plain Java widgets and run them on every Minecraft version from 1.7.10 to 26.3, on Fabric, Quilt, Legacy Fabric, Forge and NeoForge. Your mod compiles against one small API jar that has no Minecraft classes in it. At runtime the library picks the backend for the running game and draws your widgets with that version's own GUI classes, so menus look like vanilla everywhere.

MyMenu.java
public Screen create(UiHost host) {
    return MenuScreen.builder("main")
            .title(Text.translatable("mymod.title", "My Mod"))
            .add(Toggle.builder("sounds")
                    .label(Text.translatable("mymod.sounds", "Sounds"))
                    .value(() -> config.sounds)
                    .onChange(v -> config.sounds = v)
                    .build())
            .footer(Button.builder("done").label(UiTexts.DONE).onPress(host::back).build())
            .build();
}

Key facts#

Package dev.xichil.mvui (test fixtures: dev.xichil.mvui.fake)
Maven repository https://maven.xichil.dev
API artifact dev.xichil.mvui:xis-mvui-api:1.0.0, as compileOnly (never bundle it)
Library mod id xis_mvui (MultiversionUi.MOD_ID)
Java the API is Java 8, so code compiled against it runs on every supported version
Side client only; on a dedicated server the library does nothing
Entry point MultiversionUi.register(modId, name, screenFactory), once, on the client, at startup
Javadoc MultiversionUi and every other class

Start here#

  1. Installation: add the Maven repository and the API dependency, declare the dependency in your mod metadata, and run a dev client.
  2. Your first menu: build and register a working menu in five steps.
  3. Build one mod for every loader: structure a mod so one codebase ships to Fabric, Quilt, Forge and NeoForge, from 1.7.10 to 26.3.

All pages#

Guides (how to do one task):

Concepts (how it works):

Widgets: which widget to use, then one page each: Button, Label, StatusLine, Toggle, Checkbox, Cycle, Dropdown, SelectList, Slider, NumberField, TextInput, MultiLineInput, StringListEditor, Keybind, ColorPicker, Section.

Examples (complete, copyable):

Players and server admins#

The wiki explains how to install the library and use its menus.

Start here

  1. Installation
  2. Your first menu
  3. Build one mod for every loader
  4. Register your menu
  5. Open your menu
  6. Several screens and dialogs
  7. Slow work: files and network
  8. Validate what players type
  9. Translate your menu
  10. Save and load settings
  11. Read and write options.txt
  12. Key bindings
  13. Test menus without Minecraft

API reference

Browse the Javadoc

Packages