Mother DocsMother Docs
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
Buy me a Coffee
Steam Workshop
Discord
  • Mother OS (Ingame Script)
  • Mother GUI
  • Mother Autopilot System (MAPS)
  • Mother Core (Script Framework)
  • Cheatsheet
  • Brand Guidelines
  • Cheatsheet
  • Mother OS (Ingame Script)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Command Line Interface (CLI)
      • Configuration
      • Modules
    • Core Modules

      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Intergrid Message Service
      • Local Storage
      • Merge Block Module
    • Extension Modules

      • Air Vent Module
      • Battery Module
      • Terminal Block Module
      • Cockpit Module
      • Connector Module
      • Display Module
      • Door Module
      • Gas Tank Module
      • Hinge Module
      • Landing Gear Module
      • Light Module
      • Piston Module
      • Programmable Block Module
      • Rotor Module
      • Screen Module
      • Sensor Module
      • Sorter Module
      • Sound Block Module
      • Thruster Module
      • Timer Block Module
      • Wheel Module
    • Compatibility
    • Examples
  • Mother GUI
    • Getting Started

      • Installation
      • Configuration
    • Commands
    • Menus
    • Views
  • Mother Autopilot System (MAPS)
    • Getting Started

      • Upgrade Guide
      • Installation
    • Modules

      • Flight Planning Module
      • Map Module
      • Flight Control Module
      • Attitude Module
      • Docking Module
  • Mother Core (Script Framework)
    • Getting Started

      • Upgrade Guide
      • Installation
      • Architecture Overview
      • Managing Script Size & Complexity
    • Building A Module
    • Mother CLI (Console)
    • Core Modules
      • Activity Monitor
      • Almanac
      • Block Catalogue
      • Clock
      • Command Bus
      • Configuration
      • Event Bus
      • Intergrid Message Service
      • Local Storage
      • Log
      • Terminal
    • Utilities

      • Color Helper
      • Number Helper
      • Security
      • Serializer
    • Tutorials
  • Powered By Mother
  • Brand Guidelines

Block Catalogue

  • Getting Blocks by Type
  • Getting Blocks by Name, Group, or Tag
  • Working with Tags
  • Reading Block Configuration
  • Running Hooks
  • Monitoring State Changes
  • Emitted Events

BlockCatalogue is Mother Core's block discovery layer. It crawls the construct, caches terminal blocks, parses block Custom Data, tracks tags, and runs hooks when other modules ask for them.

It is also the backbone behind most helper methods exposed on BaseModule, including GetBlocksByName<T>().

Getting Blocks by Type

Use GetBlocks<T>() when you want every block of a type, optionally filtered.

ThrusterModule.cs
List<IMyThrust> allThrusters = GetModule<BlockCatalogue>().GetBlocks<IMyThrust>();

List<IMyThrust> hydrogenThrusters = GetModule<BlockCatalogue>().GetBlocks<IMyThrust>(
    thruster => thruster.BlockDefinition.SubtypeName.Contains("Hydrogen")
);

Getting Blocks by Name, Group, or Tag

GetBlocksByName<T>() resolves three different targets:

  1. A block name.
  2. A block group name.
  3. A tag when the string starts with #.
DockingModule.cs
IMyShipConnector connector = GetBlocksByName<IMyShipConnector>("Dock Connector")
    .FirstOrDefault();

List<IMyThrust> lateralThrusters = GetBlocksByName<IMyThrust>("Lateral Thrusters");
List<IMyThrust> dockingThrusters = GetBlocksByName<IMyThrust>("#docking");

Working with Tags

Tags are stored in block Custom Data under [general] tags= and avoid the construct-merge problems of vanilla block groups.

Hydrogen Thruster > Custom Data
[general]
tags=docking,retro

You can also set a tag from code. SetBlockWithTag() accepts a block instance, not a block name.

DockingModule.cs
IMyShipConnector connector = GetBlocksByName<IMyShipConnector>("Dock Connector")
    .FirstOrDefault();

if (connector != null)
    GetModule<BlockCatalogue>().SetBlockWithTag(connector, "docking");

Reading Block Configuration

GetBlockConfiguration() returns a MyIni snapshot for a block that Mother has already parsed.

DisplayModule.cs
IMyTextSurfaceProvider panel = GetBlocksByName<IMyTextSurfaceProvider>("Bridge LCD")
    .FirstOrDefault();

if (panel != null)
{
    MyIni config = GetModule<BlockCatalogue>().GetBlockConfiguration(panel as IMyTerminalBlock);
    string profile = $"{config.Get("general", "profile")}";
    Mother.Print($"Display profile: {profile}");
}

Running Hooks

Hooks are command strings stored in block Custom Data or in the programmable block configuration. BlockCatalogue resolves them and forwards the command text to CommandBus.

Connector > Custom Data
[hooks]
onLock=light/color "Dock Light" red;
onUnlock=light/color "Dock Light" green;
DockingModule.cs
IMyShipConnector connector = GetBlocksByName<IMyShipConnector>("Dock Connector")
    .FirstOrDefault();

if (connector != null)
    GetModule<BlockCatalogue>().RunHook(connector, "onLock");

Monitoring State Changes

The usual pattern is to let your module register state monitoring through the BaseModule helper RegisterBlockTypeForStateMonitoring<T>(), while BlockCatalogue performs the batched checks behind the scenes.

DockingModule.cs
public override void Boot()
{
    RegisterBlockTypeForStateMonitoring<IMyShipConnector>(
        connector => connector.Status,
        (block, state) =>
        {
            var connector = block as IMyShipConnector;
            var status = state as MyShipConnectorStatus?;

            if (connector != null && status == MyShipConnectorStatus.Connected)
                GetModule<BlockCatalogue>().RunHook(connector, "onLock");
        }
    );
}

BlockCatalogue processes monitored blocks in batches of 50 per cycle, which keeps continuous monitoring affordable on larger constructs.

Emitted Events

EventWhen it fireseventData
BlockConfigChangedEventAny cached block Custom Data changes during runtimeIMyTerminalBlock
SystemConfigChangedEventThe programmable block Custom Data changes during runtimeIMyTerminalBlock
Last Updated: 5/2/26, 10:05 PM
Contributors: Luke Morrison, lukejamesmorrison, Copilot
Prev
Almanac
Next
Clock