Starbound

Starbound

Not enough ratings
Modding: Recipe Guide
By Ceterai
Created a new awesome item and want to make a way to get it ingame without /spawnitem? This guide is for you!
WEBSITE[ceterai.github.io] | SUPPORT ME[buymeacoffee.com]
   
Award
Favorite
Favorited
Unfavorite
Creating a recipe
This is your first step to make an item craftable.
To create a recipe for your item, you need to create a .recipe file.

File Name
Name it however you want, but stick to latin characters and numbers.

File Content
Open this file with Notepad or an alternative text editor, and paste this code there:
{ "input" : [ { "item" : "requireditem1", "count" : 999 }, { "item" : "requireditem2", "count" : 999 }, { "item" : "requireditem3", "count" : 999 } ], "duration" : 999, "output" : { "item" : "youritem", "count" : 1 }, "groups" : [] }
What is all of this?
  • input - a list of crafting ingredients. Separate them with commas. The last item in this list should NOT have a comma after it, even if this list contains only one item;
  • item - the itemName attribute of the item;
  • count - the amount of this item;
  • duration [optional] - how long your item will take to craft it;
  • output - the item you will get from this recipe;
  • groups - a specific list of parameters (separated with commas) which tell the game where you can craft this item (at what crafting stations). More on this next.

Groups config
The first thing you should put in groups is a crafting station. Examples:
  • empty hands (no crafting station): "plain";
  • campfire: "campfire";
  • manipulator's table: "craftingmanipulator";
  • etc. (for full list visit assets/recipes or assets/packed/recipes)
Next thing you can add there is the tab where the recipe will be:
  • "storage"
  • "decoration"
  • "beds"
  • "consumables"
  • "doors"
  • "armours"
  • "weapons"
  • etc.
Last step - add "all" to groups, and you're done here!

Treasured Trophies
If you want to make your recipe available at Treasured Trophies, change groups to ["treasuredtrophies"]
Note! Making it available at Treasured Trophies will also make it available even if the player hasn't discovered the recipe yet.

Tabula Rasa
To make your item available at Tabula Rasa, add "mod" in the end of groups: [..., "mod"]
Note! Making it available at Tabula Rasa will also make it available even if the player hasn't discovered the recipe yet.

Examples
{ "input" : [ { "item" : "moonrock", "count" : 150 }, { "item" : "durasteelbar", "count" : 20 } ], "duration" : 5, "output" : { "item" : "youritem", "count" : 1 }, "groups" : [ "craftinganvil3", "weapons", "all" ] }
{ "input" : [ { "item" : "diamond", "count" : 30 } ], "output" : { "item" : "youritem", "count" : 5 }, "groups" : [ "treasuredtrophies", "mod" ] }
{ "input" : [ { "item" : "crystal", "count" : 15 }, { "item" : "durasteelbar", "count" : 1 } ], "output" : { "item" : "humantier4legs", "count" : 1, "parameters" : { "colorIndex" : 3 } }, "groups" : [ "craftingmanipulator", "armours", "all", "mod" ] }
Making a recipe available
Now your recipe is in the game, but your character has to discover it to use it.
There are plenty of ways to go about this, and I will list a few here.
Note! All undiscovered recipes are still available in /admin mode.

Discovered by default
To make your recipe discovered by default, you need to create a file called player.config.patch
The game will use this file to modify its original player.config file, where all default recipes are listed.
Open player.config.patch with Notepad or other text editor and paste this:
[ { "op": "add", "path": "/defaultBlueprints/tier1/0", "value": { "item": "youritem1" } }, { "op": "add", "path": "/defaultBlueprints/tier1/0", "value": { "item": "youritem2" } }, { "op": "add", "path": "/defaultBlueprints/tier1/0", "value": { "item": "youritem3" } } ]
Here youritem1, youritem2 and youritem3 are itemName attributes of your items.

Discovered from an item
If you want your recipes to be discovered when player picks up a specific item, you should do the following:
  • open the file of this specific item (example: youritem.item);
  • add the following string there:
"learnBlueprintsOnPickup" : ["youritem1", "youritem2", "youritem3"],
As a result, when you pickup youritem, you will discover recipes for youritem1, youritem2 and youritem3.

Dicovered from a blueprint
To get the blueprint of your item ingame, spawn it through /spawnitem command like this:
/spawnitem youritem-recipe
Using this blueprint will discover the recipe.
If you want this blueprint to randomly spawn in chests, navigate to assets/treasure to learn more about how treasurepools work.

Available at Treasured Trophies
Some crafting stations like Treasured Trophies (yes, it is technically a crafting station) do not require recipes to be discovered - all recipes there are available from the start.
Because of that, recipes that have "treasuredtrophies" in the "groups" field will always be available from the start in Treasured Trophies.

You can check whether a crafting station is requiring recipes to be discovered in its config file.
For Treasured Trophies it is "/interface/windowconfig/craftingmerchant.config".
If you don't know where the config file you need is located, check the value of the "config" field in the "interactData" section of the .object file of the crafting station you're working with.

Once you open the config file, look for the "requiresBlueprint" field. If it is set to false, the crafting station doesn't require recipes to be discovered.

The other station that doesn't require recipes to be discovered is Tabula Rasa from a mod with a similar name. To make your recipe to be available there, add "mod" in "groups" field of your recipe.
Learn More
There are more things to know about what's possible with recipes!
Like custom parameters and generated items.

Custom Parameters
You can pass custom parameters to the item you generate by specifying a parameters field:
{ "input" : [ { "item" : "crystal", "count" : 15 }, { "item" : "durasteelbar", "count" : 1 } ], "output" : { "item" : "youritem", "count" : 1, "parameters" : { "shortdescription" : "Brand New Name!" } }, "groups" : [] }
These parameters will overwrite your item's default values (in most cases).

Generated Items
You can create recipes for randomly generated items:
{ "input" : [ { "item" : "crystal", "count" : 15 }, { "item" : "durasteelbar", "count" : 1 } ], "output" : { "item" : "generatedgun", "count" : 1, "data" : { "definition" : "commonassaultrifle", "level" : 1 } }, "groups" : [] }

Codexes and blueprints
You can use codex and blueprint items in recipes, as both inputs and outputs.
For this, add either -codex or -recipe to the itemName accordingly:
{ "input" : [ { "item" : "slimebed-recipe", "count" : 2 } ], "output" : { "item" : "apexhistory2-codex", "count" : 40 }, "groups" : [] }
Spawning codex: https://community.playstarbound.com/threads/spawning-codex.120744/
Spawning blueprint: https://community.playstarbound.com/threads/spawning-blueprints.121833/

More Information
Even more inresting and useful info can be found here:
https://starbounder.org/Data:Assets/recipes

Starbounder guide on how to make recipes:
https://starbounder.org/Guide:Making_a_recipe

A thread regarding multiple recipes for the same item:
https://community.playstarbound.com/threads/multiple-recipes-different-craft-times.127327/
Conclusion
That is all I can share with you on this topic. I will expand it if I find/learn more about it.
This information has been partially presented as part of other guides here, but I've decided to bring it all together in a separate topic.
Tell me if I missed anything, your feedback is always appreciated.
Hope this guide will help you!
4 Comments
Ceterai  [author] 20 Jan, 2024 @ 4:06pm 
I mean, you can learn a recipe for an item by getting/spawning its blueprint (as described in the Making a recipe available section):
/spawnitem youritem-recipe
For example /spawnitem bonechair-recipe
Not sure if there's a way to forget a certain recipe.
Also keep in mind that while in admin, you should be able to see all recipes regardless of whether you've learned them or not.
Rynnex 19 Jan, 2024 @ 9:28am 
Not exactly what I needed but is there like a admin command in-game that can manually toggle a certain recipe on/off? Playing modded & for some reason I don't have the recipe for torches on my character.
Jello Fox 11 Jul, 2021 @ 4:17pm 
This helped me figure out why nothing I was doing worked. There are still a few things I need to figure out but thanks for this as it helped a ton.
Kira Yoshikage 24 Mar, 2020 @ 11:37pm 
Very nice