ModMenu Integration

Now, you've created your config screen, you may want to add it to ModMenu.

Adding ModMenu with Gradle

build.gradle
dependencies {
    [...]
    modApi "com.terraformersmc:modmenu:ABC"
}

Replace ABC with the version of ModMenu desired, the versions of ModMenu can be found at Linkie Web.

Creating the ModMenu entrypoint

Create a class that is implementing ModMenuApi

ExampleModMenuIntegration.class
public class ExampleModMenuIntegration implements ModMenuApi {
}

Override the config screen method to provide our screen.

ExampleModMenuIntegration.class
public class ExampleModMenuIntegration implements ModMenuApi {
    [...]
    @Override
    public ConfigScreenFactory<?> getModConfigScreenFactory() {
        return parent -> {
            // Return the screen here with the one you created from Cloth Config Builder
        };
    }
}

Add your entrypoint to fabric.mod.json.

fabric.mod.json
"entrypoints": {
    "modmenu": [
        "full.path.to.ExampleModMenuIntegration"
    ]
}

Last updated