Open your menu

Every way a player reaches a registered menu - the Options screen button, the Mod menus list, the mod list's Config button and your own code.

Last updated

Steps

Once registered, a menu can be opened in up to three ways. The first two need no code.

The Options screen#

The library adds one button to the game's Options screen:

Registered menus The button reads It opens
Only yours your ScreenFactory.buttonLabel() (default Menu...) your menu
Several Mod menus... a "Mod menus" list with one button per mod, labelled with the name passed to register

Override buttonLabel() to name the button after your mod. Vanilla's convention ends labels that open a screen with ...:

@Override
public Text buttonLabel() {
    return Text.translatable("mymod.menu", "My Mod...");
}

When a mod's menu has turned off after an error, its button in the "Mod menus" list is greyed out (see Failure isolation).

The mod list's Config button#

Loader What you do
Forge 1.13.2 – 26.3, NeoForge Nothing, as long as register runs in your @Mod constructor.
Fabric and Quilt with Mod Menu Nothing: it works for every mod that depends on xis_mvui.
Forge 1.8 – 1.12.2 guiFactory = MultiversionUi.LEGACY_FORGE_GUI_FACTORY in your @Mod.
Forge 1.7.10 guiFactory = MultiversionUi.CPW_FORGE_GUI_FACTORY in your @Mod.

If the library can't add a mod's menu to the mod list, it logs that and the Options screen button still works.

From your own code#

To open the menu from your own key binding or a button on another screen, ask for it as the running version's screen object:

Object screen = MultiversionUi.menuScreen("mymod", currentScreen);

Next steps#