Skip to content

Subscribing

Dylan Brose edited this page Sep 28, 2026 · 1 revision

Subscribing

subscribe tells you when a catalog kind changed (item, fluid, loot, …). It does not return the documents. Pull with list, or use track to keep a copy in memory.

await registry.subscribe({ kinds: ["item", "fluid", "recipe"], source: "mymod" }, (event) => {
  void registry.list(event.kind, {
    source: event.source,
    vanilla: false,
  });
});

const overlayFluids = await registry.list("fluid", { vanilla: false });
Field Meaning
kinds Which tables to watch
source Ignore notifications from that pack (pass your own source so you do not reload yourself)

The callback receives { kind, source?, dropped? }. A register that did not change the host’s stored set does not notify.

Clone this wiki locally