Skip to main content
Glama

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
NameRequiredDescriptionDefault
amountNoNumber to hunt (default: 1)
durationNoMax duration in seconds (default: 60)
targetNameNoOptional: Specific name of the target
targetTypeYesType 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"] },
  • 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] }; });
  • 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); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leo4life2/minecraft-mcp-http'

If you have feedback or need assistance with the MCP directory API, please join our Discord server