detect-gamemode
Identify the current game mode in Minecraft to enable appropriate AI-controlled actions and interactions within the game world.
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 returns the current game mode of the bot by accessing bot.game.gameMode.async (): Promise<McpResponse> => { try { return createResponse(`Bot gamemode: "${bot.game.gameMode}"`); } catch (error) { return createErrorResponse(error as Error); } }
- src/bot.ts:634-646 (registration)The registration of the 'detect-gamemode' tool using server.tool() with an empty input schema and inline 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); } } ); }