get-block-info
Retrieve detailed block data at specific coordinates in Minecraft using this tool. Input X, Y, Z values to access block information, enabling precise in-game interactions and exploration.
Instructions
Get information about a block at the specified 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:446-459 (handler)Handler function that retrieves block information at the specified coordinates using bot.blockAt and returns details about the block.async ({ x, y, z }): Promise<McpResponse> => { try { const blockPos = new Vec3(x, y, z); const block = bot.blockAt(blockPos); if (!block) { return createResponse(`No block information found at position (${x}, ${y}, ${z})`); } return createResponse(`Found ${block.name} (type: ${block.type}) at position (${block.position.x}, ${block.position.y}, ${block.position.z})`); } catch (error) { return createErrorResponse(error as Error); } }
- src/bot.ts:441-445 (schema)Input schema defining x, y, z coordinates using Zod validation.{ x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), },
- src/bot.ts:438-459 (registration)Registration of the get-block-info tool using McpServer.tool, including name, description, schema, and handler.server.tool( "get-block-info", "Get information about a block at the specified 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 { const blockPos = new Vec3(x, y, z); const block = bot.blockAt(blockPos); if (!block) { return createResponse(`No block information found at position (${x}, ${y}, ${z})`); } return createResponse(`Found ${block.name} (type: ${block.type}) at position (${block.position.x}, ${block.position.y}, ${block.position.z})`); } catch (error) { return createErrorResponse(error as Error); } }