get-position
Retrieve the current coordinates of your Minecraft character to track location and enable precise navigation in the game world.
Instructions
Get the current position of the bot
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/position-tools.ts:15-24 (handler)The handler function retrieves the bot's current entity position, floors the X, Y, Z coordinates, formats them into a string, and returns it via factory.createResponse.
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)Registration of the "get-position" tool with factory.registerTool, including name, description, empty input schema, and inline handler function.
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 call to registerPositionTools function, which registers the get-position tool among others.
registerPositionTools(factory, getBot);