move-to-position
Command a Minecraft bot to navigate to precise coordinates (x, y, z) within the game world, with adjustable proximity range for accurate positioning.
Instructions
Move the bot to a specific position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | How close to get to the target (default: 1) | |
| x | Yes | X coordinate | |
| y | Yes | Y coordinate | |
| z | Yes | Z coordinate |
Implementation Reference
- src/bot.ts:183-192 (handler)Handler function that uses the pathfinder to create a GoalNear and move the bot to the target position with optional range tolerance.async ({ x, y, z, range = 1 }): Promise<McpResponse> => { try { const goal = new goals.GoalNear(x, y, z, range); await bot.pathfinder.goto(goal); return createResponse(`Successfully moved to position near (${x}, ${y}, ${z})`); } catch (error) { return createErrorResponse(error as Error); } }
- src/bot.ts:177-182 (schema)Zod input schema defining the parameters for the move-to-position tool: x, y, z coordinates and optional range.{ x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), range: z.number().optional().describe("How close to get to the target (default: 1)") },
- src/bot.ts:174-193 (registration)Registration of the 'move-to-position' tool in the registerPositionTools function using McpServer.tool method.server.tool( "move-to-position", "Move the bot to a specific position", { x: z.number().describe("X coordinate"), y: z.number().describe("Y coordinate"), z: z.number().describe("Z coordinate"), range: z.number().optional().describe("How close to get to the target (default: 1)") }, async ({ x, y, z, range = 1 }): Promise<McpResponse> => { try { const goal = new goals.GoalNear(x, y, z, range); await bot.pathfinder.goto(goal); return createResponse(`Successfully moved to position near (${x}, ${y}, ${z})`); } catch (error) { return createErrorResponse(error as Error); } } );