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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "detect-gamemode"
}
}Input 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); } } ); }