HomeCommandsExamplesGetting Started With ScriptsGlobal Keywords
Generic JSON Recipes

AlloyBuilder

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import mods.tfc.AlloyBuilder;

Methods

add a metal to the alloy

script.zs
// AlloyBuilder.Add(metal as Metal, min as double, max as double)
myAlloyBuilder.Add(<metal:tfc:copper>, 0.88, 0.92);
ParameterTypeDescription
Parameter
metal
Type
Metal
Description
metal
Parameter
min
Type
double
Description
min amount
Parameter
max
Type
double
Description
max amount

add a metal to the alloy

script.zs
// AlloyBuilder.Add(metalName as string, min as double, max as double)
myAlloyBuilder.Add("tfc:copper", 0.88, 0.92);
ParameterTypeDescription
Parameter
metalName
Type
string
Description
name of the metal
Parameter
min
Type
double
Description
min amount
Parameter
max
Type
double
Description
max amount

Add a metal as output

script.zs
// AlloyBuilder.Output(metal as Metal)
myAlloyBuilder.Output(<metal:tfc:bronze>);
ParameterTypeDescription
Parameter
metal
Type
Metal
Description
metal

Add a metal as output

script.zs
// AlloyBuilder.Output(name as string)
myAlloyBuilder.Output("bronze");
ParameterTypeDescription
Parameter
name
Type
string
Description
name of the metal