Creators

Custom Creators are Modular components that provide UI for creating new elements. They appear as buttons in the project browser and show forms/modals for collecting initial data.

Key Differences from Editors:

  • Use module.exports = (NOT export default function)

  • Arrow function syntax

  • Inline styles only (no CSS files)

  • Use onNext(data) to enable/disable creation


Registration (main.js)

api.nexomaker.registerModularCreator(creatorId, componentPath, metadata)

module.exports.init = async () => {
  api.nexomaker.registerModularCreator(
    'create_armor',                              // Must start with 'create_'
    __dirname + '/creators/ArmorCreator.jsx',    // String concatenation, NOT path.join
    {
      label: 'Armor',
      icon: 'Shield',
      category: 'item',
      compatibility: ['nexo', 'itemsadder', 'oraxen', 'craftengine']
    }
  );
};

Parameters

Parameter
Type
Required
Description

creatorId

string

Yes

Unique ID (must start with 'create_')

componentPath

string

Yes

Path to .jsx file (use __dirname + '/path/file.jsx')

metadata.label

string

No

Button text

metadata.icon

string

No

Icon name (e.g., 'Shield')

metadata.category

string

No

Category grouping

metadata.compatibility

string[]

No

Compatible plugin IDs


Component Structure (.jsx file)

Basic Template

Props Available

Prop
Type
Description

useState

Hook

State hook (passed as prop, NOT imported)

useEffect

Hook

Effect hook (passed as prop, NOT imported)

useMemo

Hook

Memo hook (passed as prop)

useRef

Hook

Ref hook (passed as prop)

onNext

Function

(data | null) => void - Enable/disable creation

projectId

string

Current project ID


Full Example (from apitest)

File: creators/ArmorCreator.jsx


How It Works

  1. User clicks creator button → Modal opens with your component

  2. User fills form → Component calls onNext(data) in useEffect

  3. User clicks "Next" → NexoMaker creates Data/{id}/item.yml with the data

  4. Item opens in appropriate editor

Data Object Requirements


Common Patterns

With Validation

Multi-Step Wizard


Styling

Use inline styles only - CSS files are NOT automatically loaded for creators.

Available CSS Variables

Common variables:

  • --col-background

  • --col-text-primary

  • --col-text-secondary

  • --col-input-background

  • --col-outliner-default

  • --radius-sm, --radius-md, --radius-lg


Common Issues

"module is not defined"

Solution: Use module.exports = (NOT export default)

"Next" Button Always Disabled

Solution: Call onNext(data) with valid data object

Creator Button Not Showing

Solution: Creator ID must start with 'create_'

Wrong Plugin Shows Creator

Solution: Add plugin to compatibility array

Path Not Found

Solution: Use __dirname + '/path/file.jsx' (NOT path.join())


Quick Reference

Aspect
Creators
Editors

Export

module.exports =

export default function

Syntax

Arrow function

Function declaration

Special Props

onNext, projectId

itemData, setContent, useWindow

CSS

Inline styles only

Separate .css file

Purpose

Create new items

Edit existing items


  • Custom Element Types

  • Custom Editors

Last updated