HomeJavaModsVanilla Options API
Vanilla Options API
ModsJava

Vanilla Options API

by Embin · on Modrinth

Which Minecraft do you have?

Every version of the game needs its own build. Pick yours, then download — the wrong build installs fine and then does nothing in the game. This mod is built for Fabric only.

⬇ Download for 26.2⬇ Download for 26.1–26.1.2
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Library that easily allows mod developers to create custom options using vanilla's systems, and add options to vanilla's option screens.

Code example:

public class MyMod implements ClientModInitializer {
  private static final OptionInstance<Boolean> OPTION = ...;

  public static OptionInstance<Boolean> option() {
    return OPTION;
  }

  @Override
  public void onInitializeClient() {
    Identifier optionId = Identifier.fromNamespaceAndPath("modid", "custom_option");
    VanillaOptionsAPI.register(optionId, OptionsMenuLocation.ACCESSIBILITY, MyMod::option);
  }
}

The following would add a boolean option that saves to options.txt as modid.custom_option, appearing in the accessibilty options menu.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more