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
AlloyPart
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, keepOriginalBounds?: boolean): AlloyPart
metal: String
: The metalmin: number
: The minimum percent, in the range [0, 1], of the metalmax: number
: The maximum percent, in the range [0, 1], of the metalkeepOriginalBounds?: boolean
: When replacing an alloy part, if the bounds should stay as they were originally in the recipe. Defaults totrue
Creates an AlloyPart
for use in alloying recipes
Example:
TFC.alloyPart('tfc:steel', 0.1, 0.5)
In json:
{
"metal": "tfc:steel",
"min": 0.1,
"max": 0.5
}
BlockIngredient
See the main page!
Method signature:
TFC.blockIngredient(blockIngredient: (String | Block | BlockState | TagKey<Block> | Regex | List<(String | Block | BlockState | tagKey<Block> | Regex)> | BlockIngredient)): 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"
}
]
FluidIngredient
See the main page!
Method signature:
TFC.fluidIngredient(fluidIngredient: (String | Fluid | TagKey<Fluid> | FluidStackJS | Regex | List<(String | Fluid | TagKey<Fluid> | FluidStackJS | Regex)> | FluidIngredient | FluidStackIngredient)): FluidIngredient
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"
}
]
FluidStackIngredient
See the main page!
Method signatures:
TFC.fluidStackIngredient(fluidIngredient: FluidIngredient, amount: number): FluidStackIngredient
TFC.fluidStackIngredient(fluidStackIngredient: (String | Fluid | TagKey<fluid> | FluidStackJS | Regex | List<(String | Fluid | tagKey<Fluid> | FluidStackJS | Regex)> | FluidIngredient | FluidStackIngredient)): 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