look-at
Directs a Minecraft bot to face specific coordinates in the game world. Use this tool to orient the character toward a target location for navigation, building, or interaction.
Instructions
Make the bot look at a specific position
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"x": "<x>",
"y": "<y>",
"z": "<z>"
},
"name": "look-at"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X coordinate | |
| y | Yes | Y coordinate | |
| z | Yes | Z coordinate |
Implementation Reference
- src/bot.ts:203-211 (handler)The handler function for the 'look-at' tool. It takes x, y, z coordinates and uses the mineflayer bot's lookAt method to direct the bot's gaze to that position, returning a success message or error.
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)Zod schema defining the input parameters for the 'look-at' tool: numeric x, y, z coordinates.
{ x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), }, - src/bot.ts:195-212 (registration)The registration of the 'look-at' tool using McpServer's tool method within the registerPositionTools function, including name, description, schema, and handler.
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); } } );