Upgrades
Create machine upgrades using Crafttweaker
Creating custom machine upgrade with Crafttweaker
//Create the upgrade builder and give it the item that will act as upgrade and the max amount of this upgrade that can be used in a machine.
mods.custommachinery.CMUpgradeBuilder.create(Item item)
//Add a machine that will accept this upgrade, the machine ID must be "namespace:id" like "custommachinery:my_machine" if the json is located in (my_datapack)/data/custommachinery/machines/my_machine.json
.machine(String machineID)
//You can add a custom tooltip to the machine upgrade item.
.tooltip(String tooltip)
//Add a modifier with mode input and operation addition
.addInput(CTRequirementType type, double value)
.addInput(CTRequirementType type, double value, String target)
.addInput(CTRequirementType type, double value, String target, double chance)
//Add a modifier with mode input and operation multiplication
.mulInput(CTRequirementType type, double value)
.mulInput(CTRequirementType type, double value, String target)
.mulInput(CTRequirementType type, double value, String target, double chance)
//Add a modifier with mode output and operation addition
.addOutput(CTRequirementType type, double value)
.addOutput(CTRequirementType type, double value, String target)
.addOutput(CTRequirementType type, double value, String target, double chance)
//Add a modifier with mode output and operation multiplication
.mulOutput(CTRequirementType type, double value)
.mulOutput(CTRequirementType type, double value, String target)
.mulOutput(CTRequirementType type, double value, String target, double chance)
//Finish (don't forget the semicolon ';')
.build();Zenscript syntax
Examples
Last updated