Skip to content

Registering

github-actions[bot] edited this page Sep 29, 2026 · 3 revisions

Registering

Vanilla Minecraft documents are already on the host (items, blocks, fluids, loot, recipes, tags, and the rest). Register only your pack’s documents.

source is a stable id for your pack: start with a letter, then letters, digits, or _. Call register every world load after waitReady(). Omit source only for data that should vanish when the session ends. Fill-in lists without writing these calls: Register template.

Each kind is its own table. Queue with add, then register with the same kind. A second register for that source and kind replaces that table.

Kinds: block, entity, fluid, gas, item, loot, pack, recipe, tag.

import { BOTTLE, BUCKET } from "@mcbe-registry/client";

registry.add("item", { id: "mymod:widget", tags: ["mymod:parts"] });
await registry.register({ source: "mymod", kind: "item" });

registry.add("fluid", {
  id: "mymod:latex",
  kind: "liquid",
  vessels: [
    { filled: "mymod:latex_bottle", empty: "minecraft:glass_bottle", amount: BOTTLE },
    { filled: "mymod:latex_bucket", empty: "minecraft:bucket", amount: BUCKET },
  ],
});
await registry.register({ source: "mymod", kind: "fluid" });

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

BOTTLE, BUCKET, and mb(n) (whole millibuckets) are exports of @mcbe-registry/client. Fluid and gas amount values must be integers. Loot chance is percent 0–100 (100 = always).

addRecipe / clearRecipes are shortcuts for kind: "recipe" only. Prefer add + kind so every table uses the same pattern.

If you omit kind on register, the host treats it as recipe. Pass kind explicitly.

unregister

Removes recipe ids. Missing ids are ignored.

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

Clone this wiki locally