Getting Started Beginner
Everything you need to set up a new NeoForge mod project that uses the SPC Addon API. By the end of this page you'll have a compiling project ready for addon development.
1. Download the API jar and put it in libs/.
2. Add compileOnly files('libs/storedprogramcontrols-1.1.2-api.jar') to build.gradle.
3. Add a spc_core dependency to neoforge.mods.toml. Done!
On this page
Prerequisites
| Requirement | Version | Notes |
|---|---|---|
| Java JDK | 21+ | Oracle or Eclipse Temurin |
| NeoForge MDK | 1.21.1 (21.1.x) | neoforged.net |
| Gradle | 8.x+ | Bundled with the MDK |
| Stored Program Controls | 0.2.0+ | Installed at runtime; API jar at compile time |
Obtain the API Jar
The SPC Addon API ships as a small standalone jar file (storedprogramcontrols-*-api.jar,
~28 KB). It contains only the public API classes โ interfaces, records, and enums.
No implementation code.
Where to get it
- Go to the SPC Addon API page on CurseForge
- Download the latest
storedprogramcontrols-*-api.jarfor your Minecraft version
Place the jar in a libs/ folder in your project root:
Project Structure
A typical SPC addon has this layout:
node/ sub-package and extensions into extension/
keeps things clean as your addon grows.
Configure build.gradle
Add the API jar as a compile-only dependency. At runtime, the full SPC mod provides everything.
dependencies {
// ... your existing NeoForge dependencies ...
// SPC Addon API โ compile-only, provided by SPC at runtime
compileOnly files('libs/storedprogramcontrols-1.1.2-api.jar')
}
compileOnly makes the API available at compile time but keeps it out of your addon jar.
The player's installed SPC mod provides the real classes at runtime โ
no duplicates, no version conflicts.
Configure neoforge.mods.toml
Your addon must declare a required dependency on spc_core.
This ensures NeoForge loads SPC before your addon and shows a helpful error
if SPC is missing.
# Your mod's main block
modLoader = "javafml"
loaderVersion = "[4,)"
license = "MIT"
[[mods]]
modId = "my_spc_addon"
version = "${file.jarVersion}"
displayName = "My SPC Addon"
description = "Custom LOGO nodes for Stored Program Controls."
# โโ Required: depend on spc_core โโโโโโโโโโโโโโโโโโโโโโโโโโ
[[dependencies.my_spc_addon]]
modId = "spc_core"
type = "required"
reason = "Provides the SPC Addon API for custom function block nodes"
versionRange = "[0.2.0,)"
ordering = "AFTER"
side = "BOTH"
# โโ Standard NeoForge dependency โโโโโโโโโโโโโโโโโโโโโโโโโโ
[[dependencies.my_spc_addon]]
modId = "neoforge"
type = "required"
versionRange = "[21.1,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.my_spc_addon]]
modId = "minecraft"
type = "required"
versionRange = "[1.21.1,)"
ordering = "NONE"
side = "BOTH"
Key fields
| Field | Value | Why |
|---|---|---|
modId | "spc_core" | The SPC identifier โ note: not storedprogramcontrols |
versionRange | "[0.2.0,)" | Minimum SPC version. [ = inclusive, ) = no upper bound |
ordering | "AFTER" | Load your mod after SPC so registries are available |
Create the @Mod Class
This is your addon's entry point. It's where you register all nodes and (optionally) context extensions. Keep this class minimal โ just registration calls.
package com.example.myaddon;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
@Mod("my_spc_addon")
public class MyAddon {
public MyAddon(IEventBus modEventBus) {
// Node registration goes here โ see the Tutorial page
// SpcNodeRegistry.register(schema, factory, category);
}
}
@Mod constructor. SPC freezes its registries during
FMLCommonSetupEvent, so anything registered after that will throw
IllegalStateException.
Verify Your Setup
- Run
./gradlew buildโ it should compile without errors - Run
./gradlew runClientwith the SPC mod jar in therun/mods/folder - Open the mod list โ you should see both "Stored Program Controls" and your addon
- If your addon node registration works, open the Programming Block GUI and check the palette
if (SpcApi.API_VERSION < 1) {
LOGGER.error("Incompatible SPC API version!");
}
What's Next?
Now that your project compiles, head to the tutorial to build your first node: