Home Commands Examples Getting Started With Scripts Global Keywords
Generic JSON Recipes

BlockIngredient

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.api.ingredient.BlockIngredient;

Static Methods

Create a block ingredient from a block

Returns:
Return Type: BlockIngredient

script.zs
// BlockIngredient.of(block as Block) as BlockIngredient
BlockIngredient.of(<block:minecraft:dirt>);
ParameterTypeDescription
Parameter
block
Type
Block
Description
block

Create a block from an array of blocks

Returns:
Return Type: BlockIngredient

script.zs
// BlockIngredient.of(blocks as Block[]) as BlockIngredient
BlockIngredient.of([<block:minecraft:dirt>, <block:minecraft:stone>]);
ParameterTypeDescription
Parameter
blocks
Type
Block[]
Description
array of blocks

Create a block ingredient from a block tag

Returns:
Return Type: BlockIngredient

script.zs
// BlockIngredient.of(tag as KnownTag<Block>) as BlockIngredient
BlockIngredient.of(<tag:blocks:minecraft:sand>);
ParameterTypeDescription
Parameter
tag
Type
KnownTag<Block>
Description
block tag