move-to-position
Guide the bot to a specified coordinate in Minecraft using X, Y, Z values and an optional range parameter for precise navigation.
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/tools/position-tools.ts:36-41 (handler)Handler function that executes the logic to move the Minecraft bot to the target position using pathfinder's GoalNear and goto method.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 for input validation of 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)Registration of the move-to-position tool with the ToolFactory, including name, description, schema, and handler.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})`); } );