cookItem
Cook items in Minecraft using a furnace by specifying the item name, fuel, and quantity. Part of the MCP server’s features for automating in-game tasks.
Instructions
Cook an item in a furnace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Number of items to cook | |
| fuelName | Yes | The fuel to use for cooking | |
| itemName | Yes | The name of the item to cook |
Implementation Reference
- The primary handler function implementing the cookItem tool. It validates input parameters (itemName, fuelName), sets default count, and delegates to useFurnace helper with action 'cook' to perform the cooking.export const cookItem = async ( bot: Bot, params: ISkillParams, serviceParams: ISkillServiceParams, ): Promise<boolean> => { const skillName = 'cookItem'; const requiredParams = ['itemName', 'fuelName']; const isParamsValid = validateSkillParams( params, requiredParams, skillName, ); if (!isParamsValid) { serviceParams.cancelExecution?.(); bot.emit( 'alteraBotEndObservation', `Mistake: You didn't provide all of the required parameters ${requiredParams.join(', ')} for the ${skillName} skill.`, ); return false; } const defaultParams = { count: 1, }; const useCount: number = Math.min(defaultParams.count, 4); return await useFurnace(bot, { itemName: params.itemName, fuelName: params.fuelName, count: useCount, action: 'cook', signal: serviceParams.signal, getStatsData: serviceParams.getStatsData, setStatsData: serviceParams.setStatsData, }); };
- Schema metadata for cookItem tool defining input parameters (itemName, fuelName, count), descriptions, and required fields. Used to build the inputSchema for the SkillDefinition.cookItem: { description: "Cook an item in a furnace", params: { itemName: { type: "string", description: "The name of the item to cook" }, fuelName: { type: "string", description: "The fuel to use for cooking" }, count: { type: "number", description: "Number of items to cook" } }, required: ["itemName", "fuelName", "count"] },
- mcp-server/src/skillRegistry.ts:353-364 (registration)Registration code within loadSkills() that iterates over SKILL_METADATA (including cookItem), creates SkillDefinition with schema and dynamic executor loader, and collects them for use in the MCP server.for (const [skillName, metadata] of Object.entries(SKILL_METADATA)) { skills.push({ name: skillName, description: metadata.description, inputSchema: { type: "object", properties: metadata.params, required: metadata.required }, execute: createSkillExecutor(skillName) }); }