
CraftingLibrary
A crafting library for Lethal Company. Scrap lying in the ship becomes other items, from recipes written in plain text or registered by other mods. Ships no recipes of its own.Maco's Crafting Library
A crafting framework for Lethal Company. It adds a CRAFT command to the ship terminal that
consumes items sitting in the ship and spawns another item in their place, following recipes
written in plain text or registered by another plugin. No dependencies beyond BepInEx, and no
recipes, items or store entries of its own: alone it is an empty menu.
The command
| Typed | Does |
|---|---|
CRAFT |
Opens the recipe list. |
CRAFT 2 |
Opens it at page 2. |
CRAFT rail slugger |
Builds one straight away. A unique prefix is enough. |
W/S move, A/D page, Enter opens a build screen for the selected recipe, Backspace
steps back and returns the keyboard. Buildable recipes sort to the top, then those closest to
complete. Circles count stock twice over: beside the name, one per ingredient covered, so ●●○○
is two of four; beside an ingredient, one per unit needed, so ●○ Saw Blade is one of two.
[Terminal] Cursor Controls swaps the screen for a printed list if another mod contests the
keyboard.
Ingredients
An item is available only if it is loose in the ship: not held, pocketed, bagged, in an enemy's
grip or mid-grab on the host. Membership is decided against the ship's collider rather than the
isInShipRoom flag the game never replicates, so client and host counts agree. A craft takes the
cheapest copies first, and the product is spawned among the parts before any of them are
destroyed, so a failed spawn costs nothing.
Anything a recipe wants reads [INGREDIENT] when scanned, and placing one on the Company counter
warns which recipe wanted it without blocking the sale. Both are local, cosmetic, configurable,
and apply only where the recipe's product is installed.
Recipes
Every .txt file in BepInEx/config/CraftingLibrary/ is read, one recipe per line. recipes.txt
is created there on first launch with the format in its header.
# comments start with #
Rail Slugger = Laser pointer, Rusted Pick Head x2, Ruby Crystal
Oxidizer = Chemical jug x2, Hand Drill | value=0 | info=Hold to spray flame.
Stun grenade x2 = Big bolt, Metal sheet x2
Names match the game's itemName, capitalisation ignored. x2 on a part is how many it
consumes, on the product it is the yield. value=N stamps the product's scrap value, value=0
makes it worth nothing so nobody sells it, and omitting it rolls the item's own range. info= is
one line shown on the build screen.
Files are re-read on every lobby load, so edit and rejoin to test. They load alphabetically after
every plugin has registered its own, and the last recipe naming a product wins, which is how you
override one a mod shipped. A name no installed mod registered is reported in LogOutput.log and
skipped.
Multiplayer
Everyone needs it installed, and the host resolves every request against its own book, so an
edited file on a client changes nothing. Grab a part while somebody is on the build screen and
their Build becomes Back within a second; a request already in flight is refused with nothing
consumed.
For mod authors
Ship a .txt file, which needs no reference to this assembly, or reference CraftingLibrary.dll
and register from your Awake:
RecipeBook.Add("Rail Slugger", "Laser pointer", "Rusted Pick Head x2", "Ruby Crystal");
Add(Recipe) also takes a yield, value, source and description; Remove, All, Consumers and
Revision are public too. Code recipes persist across lobbies, and a recipe file can override one
by naming the same product. Add MACO-CraftingLibrary to your manifest.
Settings live in Maco.CraftingLibrary.cfg: the command word, the terminal's front-page entry,
the driven screen, width and height overrides for the box, both warnings and verbose logging. The
mod patches Terminal.ParsePlayerSentence as a prefix and passes everything else through. Built
against Lethal Company v81.
Why it exists
I wanted some of the items in my own modpack crafted out of scrap instead of bought, and needed something generic to do it with. Splitting it out in case anyone else wants the same thing.
Made with AI
All of the code in this mod was written by Claude (Anthropic's AI, through Claude Code), directed and play-tested by me. It ships no items, models or recipes of its own: everything it shows is built at runtime out of the game's own objects and whatever recipes are installed.