ElytraF5 & more · API 1
API reference

Types and contracts

All public types are in net.turtle.ef5am.api.client.settings. The API is provided by the client source set.

ElytraF5SettingsApi

MemberBehavior
API_VERSIONCurrent compatibility constant: 1.
registerCategory(category)Registers a category during client initialization. Throws if an ID is malformed or already registered, or if options fail validation.
registeredCategories()Returns a snapshot of categories registered so far.

SettingsCategory

SettingsCategory(
    id: String,
    title: Component,
    options: List<SettingsOption>,
    icon: Identifier? = null
)

Common SettingsOption fields

Every option has an ID unique within its category, a title and a description. The description is shown as a tooltip; use a translatable component.

BooleanSettingOption

BooleanSettingOption(
    id, title, description,
    currentValue: () -> Boolean,
    onChanged: (Boolean) -> Unit
)

The currentValue provider is read when the screen is created. Your callback should update your in-memory config value.

ChoiceSettingOption

ChoiceSettingOption(
    id, title, description,
    choices: List<SettingsChoice>,
    currentChoice: () -> String,
    onChanged: (String) -> Unit
)

SettingsChoice(id: String, title: Component)

Choice IDs must be unique, and currentChoice() must match one registered choice when the category is registered. The button displays the choice title, while the callback receives its ID.

ActionSettingOption

ActionSettingOption(
    id, title, description,
    buttonTitle: Component,
    action: (Screen) -> Unit
)

The callback receives the current ElytraF5 screen. Pass it as the parent screen when opening a child screen so the back action returns to the right place.

Validation and limits

  • Category IDs are globally unique; option IDs are unique within their category.
  • Option IDs accept lowercase letters, digits, ., _ and -.
  • A choice selector must have at least one choice and may not contain duplicate IDs.
  • A missing or unavailable icon uses a fallback icon.
  • Additional categories and long option lists can be reached by scrolling.
  • Value providers and callbacks remain owned by the contributing mod; the API does not serialize your config.

Read the integration examples →