Moddable Prefab (U7 ✅)

If you liked this item, please rate it up on Steam Workshop page.

Author: Luke ✞ Jesus Saves ✞

Last revision: 6 Oct, 2025 at 20:16 UTC

File size: 77.23 KB

On Steam Workshop

Description:

With this mod, modders can make a lot more with 100% code-less mods (using JSONs). Previously they cannot modify values put inside a Prefab (including buildings’ Science cost, Material , Power etc.) without using code. Now they can do it with JSONs.

Note to players: This mod does nothing by itself. It is for modders to create mods and you probably subscribe to this mod as a dependency for other mods to work.

Simply create blueprints files and that’s it. It can be BlueprintsPrefabModderAddLumbermill.json, the name and path does not matter as long as it is in the Blueprints folder. Below are some examples of what you can do with this mod.

If you need any help, please ping me on the Timberborn’s Official Discord server. You can also check out my Modding Guide[datvm.github.io] for more information on where to find out about the names and values (right now it’s still a WIP but the first 2 parts are already there). You can also check out Berry Bie and Timbits & Timbots, they are JSON-only mods (no C# code or assets).

For more info, contact me on official Discord ( https://discord.gg/timberborn ), on #mod-creator channel or Moddable Prefab[discord.com] channel.

===

Change logs

v7.2.0: You can now specify Factions that the modifiers apply to.

v7.1.2: Should work with April 02 update now, dependent mods don’t need to do anything.

v7.1.1:
– Fixed Prefab being modified twice again when the game is loaded the 2nd time onwards. This mostly affected "AppendArray" specs.
– Added a Distinct() call for all "AppendArray" specs so string[] or array of structs should only contain unique values when multiple mods append the same values.

v7.1.0:
– Added PrefabAddComponentSpec support for adding components to a prefab (GameObject).
– Allow single quote in the NewValue property instead of double quote only. They are converted into double quote under the hood. Use if you want to keep it as .
– Allow underscore _ as ValuePath to set the current Component value.

Remove all sciences

Set all BuildingSpec _scienceCost to 0, which means all buildings are unlocked from start:

{ "PrefabModderSpec": { "ComponentType": "Timberborn.Buildings.BuildingSpec", // BuildingSpec is valid but a full name is better "ValuePath": "_scienceCost", "NewValue": "0" } }

Change a specific building:

Now it’s not very good to apply a change to all buildings. Let’s change only the Dam by… adding 1 Science cost:

{ "PrefabModderSpec": { "ComponentType": "Timberborn.Buildings.BuildingSpec", // BuildingSpec is valid but a full name is better "PrefabNames": [ "Dam.Folktails", "Dam.IronTeeth" ], // Optional in case multiple things may match the ComponentType "ValuePath": "_scienceCost", "NewValue": "1", // It must be a string that is a JSON "AppendArray": true, // We will use this later but here it is ignored because the value is not an array "Factions": [ "Folktails", "IronTeeth" ] // Optional, if not specified, it applies to all factions } }

Change building material cost:

Say we want to make Dam cheaper by adding 1 Plank to it:

{ "PrefabModderSpec": { "ComponentType": "Timberborn.Buildings.BuildingSpec", "PrefabNames": [ "Dam.Folktails", "Dam.IronTeeth" ], "ValuePath": "_buildingCost", "NewValue": "[{"_goodId": "Plank", "_amount": 1}]", "AppendArray": true // Add to the array instead of replacing it } }

Now that’s a little too much, now it costs 20 Logs and 1 Plank. Let’s change the cost completely to 10 Logs and 1 Plank:

{ "PrefabModderSpec": { "ComponentType": "Timberborn.Buildings.BuildingSpec", "PrefabNames": [ "Dam.Folktails", "Dam.IronTeeth" ], "ValuePath": "_buildingCost", "NewValue": "[{"_goodId": "Log", "_amount": 10}, {"_goodId": "Plank", "_amount": 1}]" } }

Note: Removing a certain value is not supported. Accessing a specific index in an array is not supported. You can only change the whole array.

Add a recipe to a building:

Well you could have done that with Moddable and Unlockable Recipe but with this mod, you can also add/remove recipes to buildings and change other stuff as well, so it’s up to your choice.

The below code add Treated Plank recipe to Lumber Mill. You can also create your own recipe and add it to the building.

{ "PrefabModderSpec": { "ComponentType": "Timberborn.Workshops.ManufactorySpec", "PrefabNames": [ "LumberMill.Folktails", "LumberMill.IronTeeth" ], "ValuePath": "_productionRecipeIds", "NewValue": "["TreatedPlank"]", "AppendArray": true // Add a new recipe } }

Add range to a building

From v7.1.0 you can now add new components into an existing prefab like a building using PrefabAddComponentSpec. The below code add ContinuousEffectBuildingSpec and RangedEffectBuildingSpec into the Hedge building:

{ "PrefabAddComponentSpec": { "ComponentType": "Timberborn.Buildings.BuildingSpec", "PrefabNames": [ "Hedge.Folktails", "Hedge.IronTeeth" ], "AddComponents": [ "Timberborn.RangedEffectSystem.ContinuousEffectBuildingSpec", "Timberborn.RangedEffectSystem.RangedEffectBuildingSpec" ] } }

You can then also add values to those components:

{ "PrefabModderSpec": { "ComponentType": "Timberborn.RangedEffectSystem.ContinuousEffectBuildingSpec", "PrefabNames": [ "Hedge.Folktails", "Hedge.IronTeeth" ], "ValuePath": "_", "NewValue": "{‘_effectSpecs’:[{‘_needId’:’Hedge’,’_pointsPerHour’:1,’_satisfyToMaxValue’:true}]}" } } { "PrefabModderSpec": { "ComponentType": "Timberborn.RangedEffectSystem.RangedEffectBuildingSpec", "PrefabNames": [ "Hedge.Folktails", "Hedge.IronTeeth" ], "ValuePath": "_", "NewValue": "{‘_effectRadius’:3}" } }

===
Source code is available at: https://github.com/datvm/TimberbornMods

Download
Required items:

Click the title to search on this site.


HarmonySteam Workshop