Skip to content

Registering Recipes

xXDMOGXx edited this page Aug 21, 2026 · 1 revision

Registering recipes

Vanilla recipes are already on the host. Register only your recipes.

Recipe document

Minimum fields:

  • id — unique string (mymod:crush_cobble)
  • stations — block ids this recipe runs on
  • inputs — bag (and/or shaped fields below)
  • outputs — products

Optional: type, pattern, key, leftover, priority, duration, energy, extra, …

Example shapeless:

await registry.register([
  {
    id: "mymod:crush_cobble",
    stations: ["mymod:crusher"],
    inputs: ["minecraft:cobblestone"],
    outputs: ["minecraft:gravel"],
  },
]);

Persist across reloads (source + rev)

const source = "mymod"; // usually your pack namespace
const rev = 1000;       // bump when your recipe set changes

const same = await registry.sync(source, rev);
if (same === true) {
  // Host already has this set
} else if (same === false) {
  await registry.register(recipes, { source, rev });
} else {
  // Timed out
}
  • source must be a valid id-style string (same rules as pack namespaces).
  • After ready, call sync or register within about a minute or the host may drop that source’s persisted data.

unregister

await registry.unregister(["mymod:crush_cobble"]);

Clone this wiki locally