Bindings
In 1.20, there was a major restructuring to how bindings/wrappers are handled in KubeJS TFC, now everything is centered under a singular TFC
object accessible in any script at any time
This provides access to various objects and methods that can be used throughout your scripts
Methods
These are methods which can be accessed directly from the TFC
object
Alloy Part
This defines an object which defines the values used in an alloy recipe’s input contents
Method signature:
TFC.alloyPart(metal: string, min: number, max: number)
Creates an AlloyPart
which can be converted to and from json easily. Only values in the range [0, 1] are valid for the min
and max
arguments
Example:
TFC.alloyPart('tfc:steel', 0.1, 0.5)
In json:
{
"metal": "tfc:steel",
"min": 0.1,
"max": 0.5
}
Block Ingredient
See the main page!
Method signature:
TFC.blockIngredient(blockIngredient: (string | Block | BlockState | TagKey<Block> | Regex | List<(string | Block | BlockState | tagKey<Block> | Regex)> | BlockIngredient))
Creates a BlockIngredient
representing the blocks/tags given. If provided a string, a #
at the beginning will cause it to be interpreted as a tag
Examples:
TFC.blockIngredient('minecraft:dirt')
TFC.blockIngredient(['tfc:rock/cobble/dacite', '#forge:stones'])
In json:
{
"block": "minecraft:dirt"
}
[
{
"block": "tfc:rock/cobble/dacite"
},
{
"tag": "forge:stones"
}
]
Fluid Ingredient
See the main page!
Method signature:
TFC.fluidIngredient(fluidIngredient: (string | Fluid | TagKey<Fluid> | FluidStackJS | Regex | List<(string | Fluid | TagKey<Fluid> | FluidStackJS | Regex)> | FluidIngredient | FluidStackIngredient))
Creates a FluidIngredient
representing the fluids/tags given. If provided a string, a #
at the beginning will cause it to be interpreted as a tag
Examples:
TFC.fluidIngredient('minecraft:water')
TFC.fluidIngredient(['minecraft:lava', '#tfc:usable_in_ingot_mold'])
In json:
{
"fluid": "minecraft:water"
}
[
{
"fluid": "minecraft:lava"
},
{
"tag": "tfc:usable_in_ingot_mold"
}
]
Fluid Stack Ingredient
See the main page!
Method signatures:
TFC.fluidStackIngredient(fluidIngredient: FluidIngredient, amount: number)
TFC.fluidStackIngredient(fluidStackIngredient: (string | Fluid | TagKey<fluid> | FluidStackJS | Regex | List<(string | Fluid | tagKey<Fluid> | FluidStackJS | Regex)> | FluidIngredient | FluidStackIngredient))
Creates a FluidStackIngredient
representing the fluids/tags given with the provided amount or with a default amount of 1000 if no amount can be assumed from the given object.
Examples:
TFC.fluidStackIngredient('minecraft:water', 10)
TFC.fluidStackIngredient(Fluid.of('minecraft:lava', 30))
TFC.fluidStackIngredient(['minecraft:water', '#minecraft:lava'], 3)
TFC.fluidStackIngredient(['tfc:lye','#tfc:metal'])
In json:
{
"ingredient": {
"fluid": "minecraft:water"
},
"amount": 10
}
{
"ingredient": {
"fluid": "minecraft:lava"
},
"amount": 30
}
{
"ingredient": [
{
"fluid": "minecraft:water"
},
{
"tag": "minecraft:lava"
}
],
"amount": 3
}
{
"ingredient": [
{
"fluid": "tfc:lye"
},
{
"tag": "tfc:metal"
}
],
"amount": 1000
}
Sub-Bindings
These are bindings which provide access to more methods in a grouped manner
Calendar
The central place for dealing with TFC’s calendar system in your scripts
Climate
The central place for interacting with TFC’s climate system in your scripts
Ingredient
The central place for creating TFC’s different ingredient types in your scripts
Item Stack Provider
The central place for dealing with TFC’s item stack providers in your scripts
Miscellaneous
A collection of various miscellaneous things that may be used in scripts