hunt
Track and hunt specific animals or mobs in Minecraft using precise targeting options. Define the target type, name, quantity, and duration to complete hunting tasks efficiently.
Instructions
Hunt animals or mobs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | Number to hunt (default: 1) | |
| duration | No | Max duration in seconds (default: 60) | |
| targetName | No | Optional: Specific name of the target | |
| targetType | Yes | Type of target: 'animal' or 'mob' |
Implementation Reference
- Core handler function for the 'hunt' tool. Validates parameters and delegates to the 'attack' helper function with adjusted parameters for hunting.export const hunt = async ( bot: Bot, params: ISkillParams, serviceParams: ISkillServiceParams, ): Promise<boolean> => { const skillName = 'hunt'; const requiredParams: string[] = []; 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 unpackedParams = { targetType: params.targetType ?? '', targetName: params.targetName ?? null, amount: params.amount ?? 4, duration: params.duration ?? 30, }; unpackedParams.duration = Math.min(unpackedParams.duration, 60); unpackedParams.amount = Math.min(unpackedParams.amount, 5); // amount and duration order is reversed for attack return attack(bot, { targetType: unpackedParams.targetType, targetName: unpackedParams.targetName, duration: unpackedParams.duration, killNumber: unpackedParams.amount, getStatsData: serviceParams.getStatsData, setStatsData: serviceParams.setStatsData, signal: serviceParams.signal, resetTimeout: serviceParams.resetTimeout, }); };
- Input schema definition for the 'hunt' tool, including description, parameters, and required fields.hunt: { description: "Hunt animals or mobs", params: { targetType: { type: "string", description: "Type of target: 'animal' or 'mob'" }, targetName: { type: "string", description: "Optional: Specific name of the target" }, amount: { type: "number", description: "Number to hunt (default: 1)" }, duration: { type: "number", description: "Max duration in seconds (default: 60)" } }, required: ["targetType"] },
- mcp-server/src/mcp-server.ts:128-135 (registration)Registers all skills (including 'hunt') as MCP tools by including them in the ListTools response.const skillTools = skillRegistry.getAllSkills().map(skill => ({ name: skill.name, description: skill.description, inputSchema: skill.inputSchema })); return { tools: [...tools, ...skillTools] }; });
- mcp-server/src/mcp-server.ts:76-81 (registration)Loads skills from skillRegistry (including 'hunt') and registers them in the SkillRegistry, making them available as tools.async function initializeSkills() { const skills = await loadSkills(); for (const skill of skills) { skillRegistry.registerSkill(skill); } }