Masterful Machinery
  • 👋MM Docs
  • 💡Base Features & Config
    • Controllers
    • Ports
      • Item Ports
      • Fluid Ports
      • Energy Ports
      • Mekanism Ports (Compat)
        • Gas Ports
        • Slurry Ports
        • Pigment Ports
        • Infusion Ports
      • Create Kinetic (Compat)
      • PneumaticCraft Air (Compat)
    • Extra Blocks
    • Structures
      • Structure Requirements
      • Common Requirements
    • Process Recipes
      • Ingredient Configs
      • Input Entries
      • Output Entries
      • Recipe Conditions
  • 🔩Compat Features
    • KubeJS Support
      • Register Controller
      • Register Port
      • Register Extra Blocks
      • Create Structures
      • Create Process Recipes
  • Tutorial Guides
    • Step by Step Datapack Edition
  • General Help
    • 🪞Custom Textures
  • 🎥Gallery
    • Coke Oven
  • 📎Archived Versions
    • Deprecated 1.16 Versions
    • Deprecated 1.18-1.19 Versions
      • Data Packs
Powered by GitBook
On this page
  1. Compat Features
  2. KubeJS Support

Register Controller

Register Controllers with Kube JS startup scripts.

PreviousKubeJS SupportNextRegister Port

Last updated 1 year ago

Startup Script

The following JavaScript example goes into the KubeJS startup_scripts folder

MMEvents.registerControllers(event => {
    event.create("my_controller")
        .name("My Controller")
        .type("mm:machine");
});

To register controllers in KubeJS, you can call MMEvents.registerControllers.

NOTE: all functions will map to the fields of the

The create function takes a string parameter which maps directly to the controller "id" field and returns a builder to set the rest of the fields for the controller.

The name function takes a string parameter which maps directory to controllers "name" field.

the type function takes a string parameter which maps directly to the controller "type" field.

🔩
Controller Json