Skip to main content
Glama

lookAt

Control player view direction in Minecraft by specifying exact coordinates to look at, enabling precise targeting for navigation and interaction tasks.

Instructions

Make the player look in a specific direction or at coordinates

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate to look at
yYesY coordinate to look at
zYesZ coordinate to look at

Implementation Reference

  • The handler function for the 'lookAt' tool. Checks if bot is connected, then uses bot.lookAt to direct the bot's gaze at the specified (x,y,z) coordinates, returning success or error response.
    async ({ x, y, z }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { await botState.bot.lookAt(new Vec3(x, y, z)) return createSuccessResponse( `Looking at coordinates: X=${x}, Y=${y}, Z=${z}` ) } catch (error) { return createErrorResponse(error) } }
  • Input schema for the 'lookAt' tool using Zod, defining required numeric parameters x, y, z coordinates.
    { x: z.number().describe('X coordinate to look at'), y: z.number().describe('Y coordinate to look at'), z: z.number().describe('Z coordinate to look at'), },
  • Registration of the 'lookAt' tool via server.tool(), including description, input schema, and inline handler function.
    server.tool( 'lookAt', 'Make the player look in a specific direction or at coordinates', { x: z.number().describe('X coordinate to look at'), y: z.number().describe('Y coordinate to look at'), z: z.number().describe('Z coordinate to look at'), }, async ({ x, y, z }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { await botState.bot.lookAt(new Vec3(x, y, z)) return createSuccessResponse( `Looking at coordinates: X=${x}, Y=${y}, Z=${z}` ) } catch (error) { return createErrorResponse(error) } } )

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/nacal/mcp-minecraft-remote'

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