Node Categories Beginner
Categories organize your nodes in the LOGO editor palette. Every node belongs to exactly one category. You can create your own categories, control their sort order, and add custom icons.
Create a SpcNodeCategory with a namespaced ID and display name.
Pass it to SpcNodeRegistry.register(). Nodes with the same category
are grouped together in the palette.
What Are Categories?
In the LOGO editor, the left-side palette shows all available nodes grouped by category. Each category has a header (like "Basic Logic", "Timers", "I/O") and contains the nodes that belong to it.
When you register a node, you pass a category. All nodes registered with the same
SpcNodeCategory instance (or the same categoryId) appear
under the same header.
Creating a Category
A category is just a record with an ID and a display name:
// Simplest form — default sort order (5000), no custom icon
public static final SpcNodeCategory MY_SENSORS =
new SpcNodeCategory("mymod:sensors", "My Sensors");
Then pass it when registering nodes:
SpcNodeRegistry.register(TEMP_SENSOR_SCHEMA, new TempSensorFactory(), MY_SENSORS);
SpcNodeRegistry.register(HUMIDITY_SCHEMA, new HumidityFactory(), MY_SENSORS);
SpcNodeRegistry.register(LIGHT_SCHEMA, new LightFactory(), MY_SENSORS);
// All three appear under the "My Sensors" header in the palette
"yourmod:category_name" to avoid collisions with other addons
or built-in categories.
Controlling Sort Order
Categories are displayed in the palette sorted by their sortOrder value.
Lower numbers appear first.
// Appears early in the palette (before most built-in categories)
new SpcNodeCategory("mymod:sensors", "My Sensors", 500)
// Appears late in the palette (after built-in categories)
new SpcNodeCategory("mymod:advanced", "Advanced", 8000)
Sort order ranges
| Range | Used by |
|---|---|
| 0 – 1000 | Built-in SPC categories (I/O, Logic, Timers, etc.) |
| 1001 – 4999 | Good range for addons that want to appear near built-in categories |
| 5000 | Default sort order (if you don't specify one) |
| 5001+ | Addons that want to appear at the end of the palette |
Custom Icons
You can give your category a custom icon that appears next to the header in the palette. Pass a resource location string pointing to a texture file:
// Category with a custom icon texture
new SpcNodeCategory(
"create:rotational", // category ID
"Create: Rotational", // display name
2000, // sort order
"create:textures/gui/cogwheel_icon.png" // icon texture path
)
Icon details
- The texture path follows standard Minecraft resource location format:
"namespace:path" - Textures are loaded from your mod's resource pack
- Recommended size: 16×16 pixels (same as Minecraft item icons)
- If you don't want an icon, pass
nullor use a shorter constructor - Check if a category has an icon:
category.hasIcon()
Built-in Categories
SPC ships with these built-in categories (you cannot modify them, but you can add nodes to them if appropriate):
| Category | Sort Order | Contains |
|---|---|---|
| I/O | 100 | Digital inputs, digital outputs, analog I/O, FE I/O |
| Basic Logic | 200 | AND, OR, NOT, XOR, NAND, NOR |
| Special Logic | 300 | Comparators, multiplexers, demultiplexers |
| Timers | 400 | On-delay, off-delay, pulse timers |
| Counters | 500 | Up counter, down counter, up/down counter |
| Math | 600 | Add, subtract, multiply, divide, modulo, min, max |
| Analog | 700 | Analog thresholds, amplifiers, limiters |
| Memory | 800 | Latches, shift registers, marker flags |
| Display | 900 | Message text, block labels |
| Sensors | 950 | Time, weather, light, entity detection |
| Effects | 1000 | Sound, particle, chat message triggers |
Multiple Categories per Addon
If your addon adds many nodes, split them into multiple categories. This keeps the palette organized and helps players find what they need.
// A Create mod addon might define several categories:
public static final SpcNodeCategory CREATE_ROTATIONAL =
new SpcNodeCategory("create:rotational", "Create: Rotational", 2000,
"create:textures/gui/cogwheel.png");
public static final SpcNodeCategory CREATE_FLUID =
new SpcNodeCategory("create:fluid", "Create: Fluid", 2100,
"create:textures/gui/fluid_pipe.png");
public static final SpcNodeCategory CREATE_LOGISTICS =
new SpcNodeCategory("create:logistics", "Create: Logistics", 2200);
// Register nodes into the appropriate category:
SpcNodeRegistry.register(ROTATION_SENSOR, new RotSensorFactory(), CREATE_ROTATIONAL);
SpcNodeRegistry.register(STRESS_GAUGE, new StressFactory(), CREATE_ROTATIONAL);
SpcNodeRegistry.register(FLUID_LEVEL, new FluidFactory(), CREATE_FLUID);
SpcNodeRegistry.register(BELT_COUNTER, new BeltFactory(), CREATE_LOGISTICS);
Full Example: Create Addon Categories
Here's a complete @Mod constructor showing how a Create addon
would organize its nodes into categories:
@Mod("spc_create")
public class SpcCreateAddon {
// ── Categories ──
static final SpcNodeCategory ROTATIONAL =
new SpcNodeCategory("spc_create:rotational", "Create: Rotational", 2000,
"spc_create:textures/gui/cogwheel.png");
static final SpcNodeCategory FLUID =
new SpcNodeCategory("spc_create:fluid", "Create: Fluid", 2100);
public SpcCreateAddon(IEventBus modEventBus) {
// Check API version compatibility
if (SpcApi.API_VERSION < 3) {
LOGGER.warn("SPC API is too old! Expected 1.1.2, found v{}", SpcApi.API_VERSION);
return;
}
// Register rotational nodes
SpcNodeRegistry.register(RPM_SENSOR_SCHEMA, new RpmSensorFactory(), ROTATIONAL);
SpcNodeRegistry.register(STRESS_SENSOR_SCHEMA, new StressSensorFactory(), ROTATIONAL);
SpcNodeRegistry.register(SPEED_CTRL_SCHEMA, new SpeedCtrlFactory(), ROTATIONAL);
// Register fluid nodes
SpcNodeRegistry.register(TANK_LEVEL_SCHEMA, new TankLevelFactory(), FLUID);
SpcNodeRegistry.register(FLOW_RATE_SCHEMA, new FlowRateFactory(), FLUID);
}
}
Best Practices
- Namespace your category IDs — always use
"yourmod:name"format - Use descriptive display names — include your mod name: "Create: Rotational" not just "Rotational"
- Group related nodes together — sensors in one category, actuators in another
- Keep sort orders in the 2000–4000 range — above built-in, below the default 5000
- Limit categories to 3–8 nodes — too many nodes in one category makes it hard to find things
- Icons are optional — don't force a bad icon; no icon is better than a confusing one
- Re-use the same category instance — define it once as a
static finalfield