A client-only JEI helper for Minecraft 1.20.1 (Forge). It makes per-layer Orb of Origin variants visible in JEI, together with their recipes.
Origins ships no JEI plugin, so JEI sees a single origins:orb_of_origin with no NBT.
That matters more than it sounds, because the orb's behaviour depends entirely on its NBT:
Map<Layer, Origin> targets = getTargets(stack);
if (targets.size() > 0) { /* re-roll only those layers */ }
else { /* re-roll EVERY layer */ }So the plain orb JEI hands you re-rolls every layer at once. Meanwhile per-layer orbs — the ones a pack defines through datapack recipes — are in no creative tab, so JEI never lists them and you cannot look up how to craft one.
Three JEI calls, nothing else:
| Call | Why |
|---|---|
useNbtForSubtypes(orb) |
Without it JEI collapses every orb into one entry |
addExtraItemStacks(variants) |
The variants exist only as recipe outputs, so nothing else would list them |
removeIngredientsAtRuntime(plainOrb) |
Hides the NBT-less orb, the one that re-rolls every layer at once |
Once listed, pressing the recipe key on a variant finds the recipe that makes it.
The third call is safe only because of the first: with subtypes registered the no-NBT stack is a
distinct entry, so removing it leaves the per-layer variants listed. Drop useNbtForSubtypes and the
same call hides every orb. Recipes are untouched either way — the item list is the only thing that
changes, so a recipe consuming a plain orb still shows it.
A per-layer orb targets one layer and clears it:
{Targets:[{Layer:"origins:origin",Origin:"origins:empty"}]}
Origin is required — getTargets drops any entry without it, which silently turns the orb
back into the "re-roll everything" case. origins:empty is registered with special = true, and
the check is layer.contains(origin) || origin.isSpecial(), so it may target a layer it is not a
member of. That is how "clear this one layer, then open its selection screen" is expressed.
OrbLayerVariants.LAYERS lists the layer ids and the display names of the stacks to add.
They must match your recipes' output NBT exactly — JEI treats different NBT as different
subtypes, so a mismatch would list a variant that no recipe produces.
The defaults are the two layers a stock Origins setup has (origins:origin and
origins-classes:class).
Origins は JEI プラグインを積んでいないため、JEI には NBT の無い珠が1個出るだけです。 その珠は全レイヤーを一度に選び直す動作になり、datapack のレシピで作る層ごとの珠は どのクリエイティブタブにも属さないので一覧に出ず、レシピも辿れません。
このMODは JEI に「珠の NBT を別種として扱う」ことと「層ごとの珠を一覧に足す」ことだけを伝えます。 サーバー側は何も変えません。