look-at
Direct the bot's gaze to a specified coordinate (x, y, z) in Minecraft, enabling precise in-game targeting for actions like navigation or interaction.
Instructions
Make the bot look at a specific position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X coordinate | |
| y | Yes | Y coordinate | |
| z | Yes | Z coordinate |
Implementation Reference
- src/bot.ts:195-212 (registration)Registration of the 'look-at' tool, including schema definition and inline handler function that uses bot.lookAt to direct the bot's gaze to specified coordinates.server.tool( "look-at", "Make the bot look at a specific position", { x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), }, async ({ x, y, z }): Promise<McpResponse> => { try { await bot.lookAt(new Vec3(x, y, z), true); return createResponse(`Looking at position (${x}, ${y}, ${z})`); } catch (error) { return createErrorResponse(error as Error); } } );
- src/bot.ts:203-211 (handler)The core handler logic for the 'look-at' tool, executing bot.lookAt(new Vec3(x, y, z), true) to make the bot look at the target position.async ({ x, y, z }): Promise<McpResponse> => { try { await bot.lookAt(new Vec3(x, y, z), true); return createResponse(`Looking at position (${x}, ${y}, ${z})`); } catch (error) { return createErrorResponse(error as Error); } }
- src/bot.ts:198-202 (schema)Input schema using Zod for validating x, y, z numeric coordinates required by the 'look-at' tool.{ x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), },