A Recursive Crafting Setup

As stated in autocrafting, the autocrafting planning algorithm cannot handle recipes where the primary output is one of the inputs. For example, it cannot handle cloning Smithing Templates.

One solution is use of a ME Level Emitter's ability to pretend to be a pattern.

This will then be used to turn on a little setup that constantly performs the craft. In this case, we will look at a setup to clone Smithing Templates.

Crafting

Configurations

  • The ME Interface (1) is set to stock the required additional ingredients: diamond and netherrack.

  • The ME Level Emitter (2) is configured with "netherite smithing template", and set to "Emit Redstone to craft item".

  • The first ME Import Bus (3) is filtered to the items the Interface is stocking. It has a Redstone Card. The redstone mode is set to "Active with signal".

  • The first ME Storage Bus (4) is set to a higher priority than the second storage bus.

  • The Molecular Assembler (5) has the pattern for duplicating the smithing template, and one smithing template already inserted manually.

    Pattern

  • The second ME Import Bus (6) is in its default configuration.

  • The second ME Storage Bus (7) is filtered to "netherite smithing template". It has a lower priority than the first storage bus.

How It Works

  1. The ME Level Emitter pretends to be a pattern due to the inserted Crafting Card and being set to "Emit Redstone to craft item". Thus, "netherite smithing template" shows up in terminals as a valid thing to autocraft.
  2. When receiving a request to craft that item, either from a player or from the system itself, the level emitter turns on.
  3. The first ME Import Bus is activated by the level emitter, and pulls out the ingredients stocked in the ME Interface.
  4. The only ME Storage Bus on the network that is able to store those ingredients is the one on the assembler.
  5. The Molecular Assembler receives the ingredients (already having 1 smithing pattern inside), and performs the craft, producing 2 smithing patterns.
  6. The second ME Import Bus extracts 1 smithing pattern.
  7. The first storage bus has a higher priority, so that smithing pattern goes back into the assembler.
  8. The second ME Import Bus extracts 1 smithing pattern.
  9. The assembler cannot receive another smithing pattern, so the second smithing pattern goes to the lower priority storage bus, inserting it into the interface.
  10. The ME Interface, not being set to stock smithing patterns, inserts it into the network.
Minecraft 1.20.6 [change]