move-to-position
Move a Minecraft character to specific coordinates (x, y, z) with adjustable proximity range for precise positioning.
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/tools/position-tools.ts:36-41 (handler)The handler function that implements the core logic of the 'move-to-position' tool by using the mineflayer pathfinder to navigate the bot to the specified coordinates within the given range.async ({ x, y, z, range = 1 }) => { const bot = getBot(); const goal = new goals.GoalNear(x, y, z, range); await bot.pathfinder.goto(goal); return factory.createResponse(`Successfully moved to position near (${x}, ${y}, ${z})`); }
- src/tools/position-tools.ts:30-35 (schema)Zod schema defining the input parameters for the tool: required numeric 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/tools/position-tools.ts:27-42 (registration)The factory.registerTool call that registers the 'move-to-position' tool, including its name, description, schema, and handler function.factory.registerTool( "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 }) => { const bot = getBot(); const goal = new goals.GoalNear(x, y, z, range); await bot.pathfinder.goto(goal); return factory.createResponse(`Successfully moved to position near (${x}, ${y}, ${z})`); } );
- src/main.ts:51-51 (registration)Top-level call to registerPositionTools, which includes registration of the 'move-to-position' tool.registerPositionTools(factory, getBot);