Creating an upgraded machine

Create a machine that is an upgrade of another custom machine.

Upgraded machines are a type of custom machine that inherit all properties from another existing custom machine.

The "parent" machine (which serves as the basis for the upgraded machine) must be an existing custom machine, from the Custom Machinery mod.

You can't make an upgraded machine out of vanilla or other mods machines.

To define an upgraded machine, simply add "parent": "namespace:machine_id" in the upgraded machine json.

Base example

This is the full content of an upgraded machine json file, that inherit all properties from the machine with id custommachinery:power_crusher.

{
    "parent": "custommachinery:power_crusher"
}

If not overridden the machine name will show as "Upgraded <name>" where <name> is the name of its parent machine, in the example above the upgraded machine's name will be "Upgraded Power Crusher".

Overriding properties

Upgraded machines can override properties of its parent machine, by specifying the same property in the upgraded machine json.

In the following example the upgraded machine will not inherit the gui property from its parent machine.

{
    "parent": "custommachinery:power_crusher",
    "gui": [
        //put some gui elements here
    ]
}

All properties from the parent machine can be overridden, a list of all properties that a custom machine can have is available here.

Recipe modifiers

Upgraded machines can include a list of recipe modifiers, that will be automatically applied when the machine is processing a recipe.

In the example below all recipes processed by the upgraded machine will require 1.5x more energy but half the time to complete the recipe.

{
    "parent": "custommachinery:power_crusher",
    "modifiers": [
        {
            "requirement": "custommachinery:speed",
	    "mode": "input",
	    "operation": "multiplication",
	    "modifier": 0.5
	},
	{
            "requirement": "custommachinery:energy_per_tick",
	    "mode": "input",
	    "operation": "multiplication",
	    "modifier": 1.5
	}
    ]
}

More info about recipe modifiers can be found here.

About recipes

By default all recipes that can be processed by the parent machine can also be processed by the upgraded machine.

This can be disabled by adding the following property in the upgraded machine json :

"allow_parent_recipes": false

If you want to make a recipe that is processable by only the upgraded machine, simply use the upgraded machine id in the recipe json/script instead of the parent machine id.

Last updated