Upgrades
Make an existing item capable of modifying recipe requirements
Machine upgrades are items that can be used to change the behaviors of a custom machine when inserted in an upgrade item component.
Upgrade items can change the following behaviours :
Recipe requirements (items, fluids, energy... consumption and production)
Machine components (capacity, max/min inputs/outputs)
Cores amount of the machine processor.
You can define any item registered in the game as machine upgrade.
The machine upgrade must be defined in a json file placed in a datapack, such as machines and recipes json.
The path of the machine upgrade json file must be : [datapack_name]/data/[namespace]/upgrade/my_upgrade.json
You can use whatever you want as [datapackname] but [namespace] and json file name must be all lowercase without spaces or special characters except _
Upgrades can also be created using KubeJS
Properties
The upgrade json has 2 mandatory properties and 5 optional properties.
Mandatory properties
Optional properties
Requirements
Name : requirements
requirementsDescription :
A list of recipe modifiers. These are used to define how the upgrade will influence the recipe processing.
Example :
This modifier will half the energy input required to process the recipe.
Components
Name : components
componentsDescription :
A list of component modifiers. These are used to define how the upgrade will influence the recipe processing.
Example :
This modifier will add 1000FE to the machine's energy capacity.
Core
Name : core
coreDescription :
A single core modifier, used to modify the amount of cores the machine can use to process recipes.
A core modifier has the following properties:
operation: addition, multiplication or exponentialmodifier: The value applied to the operation.max: The max amount of cores the machine can have after applying the upgrade.Optional (default = 32).
min: The min amount of cores the machine can have after applying the upgrade.Optional (default = 1).
tooltip: The tooltip displayed on the upgrade item.Optional (A default tooltip will be displayed).
Example :
This core modifier will add 2 cores to the machine processor.
Max
Name : max
maxDescription :
A positive integer that define the maximum amount of upgrades of this type that can be applied in a machine at a time.
Each item in a stack count as a separate upgrade.
This does not limit the stack size in the upgrade slot, but upgrades in excess won't be taken in account.
Default : 64
Example :
Only 4 upgrades can be applied in the machine.
Tooltip
Name : tooltip
tooltipDescription :
The tooltip that will render when a player hover any machine upgrade item in a gui. This is a text component.
Default :
Example :
The tooltip will be "Speed upgrade MK1" in orange.
Example
The machine upgrade json below make a vanilla diamond item half the recipe duration in the Custom Machinery Power Crusher included in the test datapack.
The upgrade below will double the machine's energy buffer, and add a second core to the machine.
Last updated