Skip to content

Development

Flamarine Elixirium edited this page Sep 28, 2023 · 5 revisions

Adding Mod Menu to your project

You can obtain the latest build via JitPack. Add following to your project's build.gradle:

repositories {
    // ...
    maven {
        name = 'JitPack'
        url = 'https://jitpack.io/'
    }
}

dependencies {
    // ...
    modImplementation "com.github.Turnip-Labs:ModMenu:<VERSION>"
}

Replace <VERSION> with the latest version, which you can find below.

Usage

  • The icon comes from the icon specified in your fabric.mod.json (as per the spec)
  • Clientside-only (Client mods are now detected according to the mod environment specified in fabric.mod.json, and thus this option is deprecated, but still used for backwards compatibility), deprecated and API badges are defined as custom objects in your fabric.mod.json as such:
    "custom": {
        "modmenu:api": true,
        "modmenu:deprecated": true,
    }
  • Mod parenting is used to display a mod as a child of another one. This is meant to be used for mods divided into different modules. The following element in a fabric.mod.json will define the mod as a child of the mod 'flamingo':
    "custom": {
        "modmenu:parent": "flamingo"
    }
  • ModMenuAPI
    • To use the API, implement the ModMenuApi interface on a class and add that as an entry point of type modmenu in your fabric.mod.json as such:
    "entrypoints": {
    	"modmenu": [ "com.example.mod.ExampleModMenuApiImpl" ]
    }
    • Features
      • Mods can provide a Screen factory to provide a custom config screen to open with the config button, and can also attach custom badges. Implement the getConfigScreenFactory method in your API implementation for the config screen button, or attachCustomBadges for custom badges.
Clone this wiki locally