Skip to main content
Glama

moveTo

Teleport a Minecraft player to precise coordinates (x, y, z) using a remote server. Ideal for navigation, exploration, or repositioning within the game world.

Instructions

Move the player to a specific location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • Handler function that implements the moveTo tool logic: initializes Movements, sets GoalBlock to target coordinates, executes pathfinder.goto with promise resolution, error handling, and 60-second timeout.
    async ({ x, y, z }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { // Set pathfinder Movements const movements = new Movements(botState.bot) botState.bot.pathfinder.setMovements(movements) // Set target position const goal = new goals.GoalBlock(x, y, z) return new Promise<ToolResponse>((resolve) => { // Start movement botState .bot!.pathfinder.goto(goal) .then(() => { resolve( createSuccessResponse( `Successfully moved to X=${x}, Y=${y}, Z=${z}` ) ) }) .catch((err) => { resolve(createErrorResponse(err)) }) // Timeout handling (if still moving after 1 minute) setTimeout(() => { resolve( createSuccessResponse( 'Movement is taking longer than expected. Still trying to reach the destination...' ) ) }, 60000) }) } catch (error) { return createErrorResponse(error) } }
  • Zod schema defining the input parameters for the moveTo tool: numeric x, y, z coordinates.
    x: z.number().describe('X coordinate'), y: z.number().describe('Y coordinate'), z: z.number().describe('Z coordinate'), },
  • Registration of the moveTo tool via server.tool, including name, description, input schema, and inline handler function.
    'moveTo', 'Move the player to a specific location', { x: z.number().describe('X coordinate'), y: z.number().describe('Y coordinate'), z: z.number().describe('Z coordinate'), }, async ({ x, y, z }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { // Set pathfinder Movements const movements = new Movements(botState.bot) botState.bot.pathfinder.setMovements(movements) // Set target position const goal = new goals.GoalBlock(x, y, z) return new Promise<ToolResponse>((resolve) => { // Start movement botState .bot!.pathfinder.goto(goal) .then(() => { resolve( createSuccessResponse( `Successfully moved to X=${x}, Y=${y}, Z=${z}` ) ) }) .catch((err) => { resolve(createErrorResponse(err)) }) // Timeout handling (if still moving after 1 minute) setTimeout(() => { resolve( createSuccessResponse( 'Movement is taking longer than expected. Still trying to reach the destination...' ) ) }, 60000) }) } catch (error) { return createErrorResponse(error) } } )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nacal/mcp-minecraft-remote'

If you have feedback or need assistance with the MCP directory API, please join our Discord server