Block reference

Crafting CPU

The Crafting CPU is the execution block behind Crafting I/O. It stores the active 3x3 recipe pattern, exposes preview information, and crafts against adjacent input and output handlers.

Craft execution endpoint Recipe preview Partially implemented
Back to block overview
In game

Busy flag and naming.

  • Right click opens endpoint naming.
  • Shift-right-click toggles the busy flag and prints the current CPU state summary.
  • Name tags also rename the endpoint locally.
Python commands

Recipe and execution methods.

  • recipe_slot_count(), recipe_slot(slot), and recipe().
  • set_recipe_slot(slot, item_id, count) and clear_recipe().
  • preview(): structured preview with recipe id, result item, and result count.
  • craft(input_side, output_side, crafts): perform immediate crafting through the adjacent handlers on those sides.
  • craft_queued(input_side, output_side): execute queued work on the CPU itself.
  • is_busy() and set_busy(busy).
  • queued_jobs() and set_queued_jobs(count).
  • side_aliases(), state(), and rename(name).
crafting_cpu.py
cpu = get_device("crafting_cpu")

if cpu is not None:
    cpu.set_recipe_slot(0, "minecraft:oak_planks", 1)
    cpu.set_recipe_slot(1, "minecraft:oak_planks", 1)
    cpu.set_recipe_slot(3, "minecraft:oak_planks", 1)
    cpu.set_recipe_slot(4, "minecraft:oak_planks", 1)
    screen.show("Preview", cpu.preview())
    crafted = cpu.craft("west", "east", 1)
    screen.show("Craft", {"crafted": crafted})