interface recipe { use item-stack.{item-stack}; /// Recipe category for the recipe book. enum recipe-category { building, redstone, equipment, misc, food, blocks, } /// Represents an ingredient in a recipe. variant ingredient { /// A specific item (e.g. "minecraft:diamond"). item(string), /// A tag group of items (e.g., "minecraft:logs"). tag(string), /// One of multiple specific items. one-of(list), } /// Represents a shaped crafting recipe. record shaped-recipe { /// The pattern of the recipe (e.g., ["# #", " s ", "# #"]). pattern: list, /// Mapping of characters in the pattern to ingredients. key: list>, /// The resulting item stack. output: item-stack, /// The recipe group (optional). group: option, /// The recipe category in the recipe book. category: option, /// Whether to show a toast notification when the recipe is unlocked. show-notification: option, } /// Represents a shapeless crafting recipe. record shapeless-recipe { /// The list of ingredients required. ingredients: list, /// The resulting item stack. output: item-stack, /// The recipe group (optional). group: option, /// The recipe category in the recipe book. category: option, } /// Represents a cooking recipe (Smelting, Blasting, Smoking, Campfire). record cooking-recipe { /// The ingredient to cook. ingredient: ingredient, /// The resulting item stack. output: item-stack, /// Experience points awarded. experience: f32, /// Cooking time in ticks. cooking-time: u32, /// The recipe group (optional). group: option, /// The recipe category in the recipe book. category: option, } /// Types of cooking stations. enum cooking-type { smelting, blasting, smoking, campfire, } /// Common interface for registering recipes. resource recipe-manager { /// Registers a shaped crafting recipe. register-shaped: func(id: string, recipe: shaped-recipe); /// Registers a shapeless crafting recipe. register-shapeless: func(id: string, recipe: shapeless-recipe); /// Registers a cooking recipe. register-cooking: func(id: string, station-type: cooking-type, recipe: cooking-recipe); } }