get-position
Retrieve the precise in-game coordinates of your Minecraft bot for accurate navigation and positioning within the MCP server environment.
Instructions
Get the current position of the bot
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/position-tools.ts:15-24 (handler)The inline handler function that implements the 'get-position' tool logic: retrieves the bot's current position, floors the x, y, z coordinates, and returns a formatted response string.async () => { const bot = getBot(); const position = bot.entity.position; const pos = { x: Math.floor(position.x), y: Math.floor(position.y), z: Math.floor(position.z) }; return factory.createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`); }
- src/tools/position-tools.ts:11-25 (registration)Registers the 'get-position' tool with ToolFactory, including tool name, description, empty input schema, and inline handler.factory.registerTool( "get-position", "Get the current position of the bot", {}, async () => { const bot = getBot(); const position = bot.entity.position; const pos = { x: Math.floor(position.x), y: Math.floor(position.y), z: Math.floor(position.z) }; return factory.createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`); } );
- src/main.ts:51-51 (registration)Top-level registration call in main.ts that invokes registerPositionTools to set up the position tools (including 'get-position') with the MCP ToolFactory and bot getter.registerPositionTools(factory, getBot);