Skip to content

About

Shows per-layer Orb of Origin variants and their recipes in JEI (Forge 1.20.1, client-side)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Orb of Origin: Layer Variants

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.

  • Minecraft: 1.20.1 / Loader: Forge 47+ / Client only
  • Requires: Origins, JEI 15+
  • License: MIT

The problem

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.

What this does

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.

Note on the NBT

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.

Adapting it to your pack

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 を別種として扱う」ことと「層ごとの珠を一覧に足す」ことだけを伝えます。 サーバー側は何も変えません。

About

Shows per-layer Orb of Origin variants and their recipes in JEI (Forge 1.20.1, client-side)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages