get-block-info
Retrieve detailed block information from a Minecraft world by specifying precise X, Y, and Z coordinates through the mcp-minecraft server API.
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/tools/block-tools.ts:113-123 (handler)The handler function that executes the tool logic: retrieves the block at the given (x,y,z) position using bot.blockAt and returns its name, type, and position.async ({ x, y, z }) => { const bot = getBot(); const blockPos = new Vec3(x, y, z); const block = bot.blockAt(blockPos); if (!block) { return factory.createResponse(`No block information found at position (${x}, ${y}, ${z})`); } return factory.createResponse(`Found ${block.name} (type: ${block.type}) at position (${block.position.x}, ${block.position.y}, ${block.position.z})`); }
- src/tools/block-tools.ts:108-112 (schema)Zod schema defining the input parameters: numeric x, y, z coordinates.{ x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), },
- src/tools/block-tools.ts:105-124 (registration)Direct registration of the "get-block-info" tool with factory.registerTool, including description, schema, and inline handler.factory.registerTool( "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 }) => { const bot = getBot(); const blockPos = new Vec3(x, y, z); const block = bot.blockAt(blockPos); if (!block) { return factory.createResponse(`No block information found at position (${x}, ${y}, ${z})`); } return factory.createResponse(`Found ${block.name} (type: ${block.type}) at position (${block.position.x}, ${block.position.y}, ${block.position.z})`); } );