get-block-info
Retrieve detailed information about Minecraft blocks by providing their exact coordinates in the game world.
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 asynchronous handler function that implements the core logic of the 'get-block-info' tool. It retrieves the bot, gets the block at the specified position, and returns information about the block or a no-block message.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)The Zod schema defining the input parameters for the 'get-block-info' tool: 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)The factory.registerTool call that registers the 'get-block-info' tool, including its name, description, input schema, and handler function.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})`); } );
- src/main.ts:53-53 (registration)The call to registerBlockTools in the main application, which includes the registration of 'get-block-info' among other block tools.registerBlockTools(factory, getBot);