shapedRecipe
fun shapedRecipe( id: Identifier, group: String, pattern: String, result: ItemStack, vararg ingredients: Pair<Char, IngredientLike>): ShapedRecipe
Content copied to clipboard
Create a new ShapedRecipe with the given information. The group string is used for finding the recipe in the recipe book. The pattern is a newline-separated string of rows. The result is the resulting ItemStack of the recipe. Any ingredients can be listed in the form char to ingredient
Example representing the hopper recipe:
shapedRecipe(
Identifier("minecraft", "hopper"),
"", // group is defaulted to empty string
"""
I I
ICI
IZ
""".trimIndent(),
ItemStack(Item.HOPPER, 1),
'I' to Items.IRON_INGOT,
'C' to Items.CHEST,
'Z' to Items.EMPTY // Prevent trailing whitespace
)
Content copied to clipboard