look-at
Direct a Minecraft character's gaze to specific coordinates using X, Y, and Z position values for precise targeting and 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/tools/position-tools.ts:52-56 (handler)The core handler function for the 'look-at' tool. Retrieves the bot instance, computes the target position as a Vec3, calls bot.lookAt to orient the bot towards it, and returns a confirmation response.async ({ x, y, z }) => { const bot = getBot(); await bot.lookAt(new Vec3(x, y, z), true); return factory.createResponse(`Looking at position (${x}, ${y}, ${z})`); }
- src/tools/position-tools.ts:47-51 (schema)Input schema using Zod validation, requiring numeric coordinates x, y, z for the target position.{ x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), },
- src/tools/position-tools.ts:44-57 (registration)The factory.registerTool call that registers the 'look-at' tool, specifying its name, description, input schema, and handler function.factory.registerTool( "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 }) => { const bot = getBot(); await bot.lookAt(new Vec3(x, y, z), true); return factory.createResponse(`Looking at position (${x}, ${y}, ${z})`); } );
- src/main.ts:51-51 (registration)Top-level call to registerPositionTools in main.ts, which triggers the registration of the 'look-at' tool among other position tools.registerPositionTools(factory, getBot);