Minecraft addon API
dev.nebulastorage.api · Java 21 · Kotlin · NeoForge 1.21.1
A simulation never owns a resource. A physical adapter must preserve inputs, outputs and its receipt in the same durable owner.
For an addon, depend on Nebula and compile against dev.nebulastorage.api. Keep optional mod adapters isolated so their classes are not loaded when that mod is absent. API version 1.0.0 is independent of the alpha release number. These addon examples target Nebula Storage alpha.7 and its renamed packages. Files published through alpha.6 still use dev.nexusstorage. Recompile addons when upgrading; Minecraft registry IDs and saved worlds remain unchanged.
Registration example
Create a public implementation of NebulaExtension and list its fully qualified class name in META-INF/services/dev.nebulastorage.api.NebulaExtension. Put that file in your JAR resources, without a .txt suffix.
The example declares the process identifier example:pressing. That declaration alone does not add a block or recipe. Register a machine adapter that recognizes your actual item, then a recipe source offering exact inputs and outputs for this capability. Registration must not access a world.
package example.nexus
import dev.nebulastorage.api.NebulaExtension
import dev.nebulastorage.api.NebulaRegistrar
import dev.nebulastorage.api.production.ProductionCapabilityId
class ExampleExtension : NebulaExtension {
override fun register(registrar: NebulaRegistrar) {
registrar.capability(ProductionCapabilityId("example:pressing"))
}
}META-INF/services/dev.nebulastorage.api.NebulaExtension
example.nexus.ExampleExtension