API Methods

Complete reference for all Settings API methods.


postAppSettingsTab(section)

Register a custom settings tab in the App Settings panel.

Parameters

Parameter
Type
Required
Description

section

Object

Settings section configuration

section.id

String

Unique identifier for the tab

section.title

String

Display title in the sidebar

section.description

String

Optional description shown at the top

section.elements

Array<Element>

Array of form elements

section.order

Number

Sort order (lower appears first, default: 999)

section.expansionId

String

⚠️

Recommended: Namespace for automatic key prefixing

section.expansionName

String

Display name for category header

Returns

Promise<{success: Boolean, message: String}>

Example

api.nexomaker.postAppSettingsTab({
  id: "my-expansion-settings",
  expansionId: "my_expansion",
  title: "My Expansion",
  description: "Configure global settings for My Expansion",
  order: 100,
  elements: [
    {
      id: "api-key",
      label: "API Key",
      type: "text",
      placeholder: "Enter your API key",
      default: ""
    },
    {
      id: "enable-feature",
      label: "Enable Feature",
      type: "checkbox",
      default: false
    }
  ]
});

postProjectSettingsTab(section)

Register a custom settings tab in the Project Settings panel.

Parameters

Parameter
Type
Required
Description

section

Object

Settings section configuration

section.id

String

Unique identifier for the tab

section.title

String

Display title in the sidebar

section.type

String

Section type: 'settings', 'category', 'separator', 'custom'

section.yamlKey

String

⚠️

Required for type='settings': 'configs', 'environment', or 'serverProperties'

section.elements

Array<Element>

⚠️

Required for type='settings': Array of form elements

section.render

Function

⚠️

Required for type='custom': Custom render function

section.order

Number

Sort order (lower appears first, default: 999)

section.description

String

Optional description

Section Types

Type
Description
Required Fields

'settings'

Standard form with elements

yamlKey, elements

'category'

Visual category header

title

'separator'

Horizontal divider line

-

'custom'

Custom HTML rendering

render

Returns

Promise<{success: Boolean, message: String}>

Example


postSettingsElementType(type, component, target)

Register a custom element type for use in settings forms.

Parameters

Parameter
Type
Required
Description

type

String

Unique identifier for the element type

component

Function

Render function that returns HTML string

target

String

Target settings: 'app', 'project', or 'both' (default: 'both')

Render Function Parameters

Your render function receives:

  • element - The element configuration object

  • value - Current value of the element

  • uniqueId - Unique ID to use for DOM element IDs

Returns

Promise<{success: Boolean, message: String, results: Object}>

Example


getAppSettings()

Get all app settings as a key-value object.

Returns

Object - Settings object from localStorage

Example


YAML Storage Keys

Project settings are stored in different YAML sections:

YAML Key
File/Section
Use Case

configs

config.yml

Main project configuration

environment

Environment config

Environment-specific settings

serverProperties

Server properties

Minecraft server properties format


Next Steps

  • Learn about App Settings →

  • Learn about Project Settings →

  • Explore Element Types →

Last updated