Skip to main content

UtilityCraft Registries

Registries let an extension add data to systems that UtilityCraft already runs. Your addon owns the new items, blocks, entities, textures, and scripts; UtilityCraft only receives the JSON-serializable definitions that connect them to its machines.

import * as DoriosLib from "DoriosLib/index.js";

DoriosLib.registry.registerFuel({
"utilitycraft:example_biomass": 12000,
});

Where registrations belong

Keep registrations in BP/scripts/config/ and import them once from its index:

BP/scripts/
├── config/
│ ├── index.js
│ ├── integrations.js
│ ├── resources.js
│ └── recipes/
│ └── index.js
└── main.js
BP/scripts/config/index.js
import "./resources.js";
import "./integrations.js";
import "./recipes/index.js";

The template's main.js imports config/index.js once. Call registry methods while modules load—not inside onTick, an interval, or an event that can run repeatedly. DoriosLib queues each payload and dispatches it after the world is ready.

Shared rules

RuleMeaning
JSON-serializable payloadUse plain objects, arrays, strings, numbers, and booleans. Functions and class instances do not belong in registry data.
Exact identifiersItem and block IDs normally include their namespace. Resource types such as example_coolant are unnamespaced storage keys.
Add or replaceA new key adds an entry. Registering a key that already exists replaces or extends it according to that registry's page. Pack and registration order matter when two addons use the same key.
Addon-owned contentPrefer your own namespace and inputs so another pack cannot unexpectedly replace the same definition.
Assets remain yoursRegistering data never creates the referenced item, block, entity, texture, or localization entry.

Choose a registry

GoalGuideMain methods
Process an item in an existing machineAdd recipes to existing machinesregisterCrusherRecipe(), registerPressRecipe(), registerInfuserRecipe(), registerMelterRecipe(), registerFurnaceRecipe(), registerCrafterRecipe()
Burn a custom item or improve coolantFuels and coolantsregisterFuel(), registerCoolant()
Move custom liquids or gases in containersFluids and gasesregisterFluidItem(), registerFluidHolder(), registerGasItem(), registerGasHolder()
Integrate a seed with plant machines and BonsaiPlants and bonsaisregisterPlant()
Add probabilistic machine lootFishing and sieve dropsregisterAutoFisherDrop(), registerSieveDrop()

For the method-level API, see the DoriosLib registry reference.

Continue with Add recipes to existing machines.