detect-gamemode
Identify the current gamemode in Minecraft automatically using this tool. Designed for the MCP Server, it enables AI-driven characters to adapt actions based on detected gamemode, enhancing in-game interaction and functionality.
Instructions
Detect the gamemode on game
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/bot.ts:638-644 (handler)The handler function for the 'detect-gamemode' tool. It retrieves the bot's current game mode from bot.game.gameMode and returns it in a formatted response.async (): Promise<McpResponse> => { try { return createResponse(`Bot gamemode: "${bot.game.gameMode}"`); } catch (error) { return createErrorResponse(error as Error); } }
- src/bot.ts:634-645 (registration)Registration of the 'detect-gamemode' tool using McpServer's tool method, specifying name, description, empty input schema, and the handler function.server.tool( "detect-gamemode", "Detect the gamemode on game", {}, async (): Promise<McpResponse> => { try { return createResponse(`Bot gamemode: "${bot.game.gameMode}"`); } catch (error) { return createErrorResponse(error as Error); } } );