move-to-position
Teleport a Minecraft bot to specified coordinates with adjustable arrival precision. Use this tool to position characters at exact X, Y, Z locations for navigation, building, or exploration tasks.
Instructions
Move the bot to a specific position
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X coordinate | |
| y | Yes | Y coordinate | |
| z | Yes | Z coordinate | |
| range | No | How close to get to the target (default: 1) |
Implementation Reference
- src/bot.ts:183-192 (handler)The handler function for the 'move-to-position' tool. It creates a pathfinder GoalNear to the specified (x,y,z) within the given range and executes bot.pathfinder.goto(goal).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 for the 'move-to-position' tool parameters: x, y, z (required numbers), range (optional number).{ 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 using McpServer.tool(), within the registerPositionTools function.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); } } );