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.
import mods.tfc.api.ingredient.BlockIngredient;
Static Methods
Create a block ingredient from a block
Returns:
Return Type: BlockIngredient
// BlockIngredient.of(block as Block) as BlockIngredient
BlockIngredient.of(<block:minecraft:dirt>);
Parameter | Type | Description |
---|---|---|
Parameter block | Type Block | Description block |
Create a block from an array of blocks
Returns:
Return Type: BlockIngredient
// BlockIngredient.of(blocks as Block[]) as BlockIngredient
BlockIngredient.of([<block:minecraft:dirt>, <block:minecraft:stone>]);
Parameter | Type | Description |
---|---|---|
Parameter blocks | Type Block[] | Description array of blocks |
Create a block ingredient from a block tag
Returns:
Return Type: BlockIngredient
// BlockIngredient.of(tag as KnownTag<Block>) as BlockIngredient
BlockIngredient.of(<tag:blocks:minecraft:sand>);
Parameter | Type | Description |
---|---|---|
Parameter tag | Type KnownTag<Block> | Description block tag |