{"record":{"id":"79a665bfdc2746a9","repo":"moeru-ai/airi","slug":"please-specify-a-player-name","errorCode":null,"errorMessage":"Please specify a player name!","messagePattern":"Please specify a player name!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"integrations/minecraft/src/plugins/follow.ts","lineNumber":49,"sourceCode":"        if (!state.following)\n          return\n\n        const target = bot.bot.players[state.following]?.entity\n        if (!target) {\n          state.following = undefined\n          throw new Error('Player not found, stopped following')\n        }\n\n        const { x: playerX, y: playerY, z: playerZ } = target.position\n\n        bot.bot.pathfinder.setMovements(state.movements)\n        bot.bot.pathfinder.setGoal(new goals.GoalNear(playerX, playerY, playerZ, options?.rangeGoal ?? 1))\n      }\n\n      bot.onCommand('follow', (ctx) => {\n        const username = ctx.command!.sender\n        if (!username) {\n          throw new Error('Please specify a player name!')\n        }\n\n        startFollow(username)\n      })\n\n      bot.onCommand('stop', () => {\n        stopFollow()\n      })\n\n      bot.onTick('tick', () => {\n        if (state.following)\n          followPlayer()\n      })\n    },\n  }\n}\n","sourceCodeStart":31,"sourceCodeEnd":66,"githubUrl":"https://github.com/moeru-ai/airi/blob/27111382b4a79a7e983289d6e983a06af185ed0f/integrations/minecraft/src/plugins/follow.ts#L31-L66","documentation":"Thrown by the 'follow' command handler in FollowCommand when ctx.command.sender is falsy. The command expects a player name as the sender/argument; without it the plugin cannot resolve a target. This is an input-validation guard at the command boundary.","triggerScenarios":"A player sends the bare command 'follow' with no argument and the command context's sender is empty; the command parser did not populate sender; the command was invoked programmatically (e.g. from a tick or another plugin) with no sender context.","commonSituations":"User types 'follow' instead of 'follow Steve'; command framework change that stopped populating sender; invoking the handler directly from non-command code.","solutions":["Provide the target player name: 'follow Steve'.","If invoking programmatically, ensure the command context carries a sender.","Add a usage hint in the thrown message so the user knows the expected syntax."],"exampleFix":"// before\n//   bot.onCommand('follow', (ctx) => {\n//     const username = ctx.command!.sender\n//     if (!username) { throw new Error('Please specify a player name!') }\n//     startFollow(username)\n//   })\n//\n// after (clearer usage + graceful message)\n//   bot.onCommand('follow', (ctx) => {\n//     const username = ctx.command!.sender\n//     if (!username) { logger.log('Usage: follow <player>'); return }\n//     startFollow(username)\n//   })","handlingStrategy":"validation","validationCode":"// Validate sender before starting follow:\n// const username = ctx.command?.sender\n// if (!username) { logger.log('Usage: follow <player>'); return }","typeGuard":"function hasSender(ctx: unknown): ctx is { command: { sender: string } } {\n  return !!ctx && typeof ctx === 'object'\n    && !!(ctx as any).command && typeof (ctx as any).command.sender === 'string'\n}","tryCatchPattern":null,"preventionTips":["Always pass a player name with 'follow <name>'.","Return a usage hint instead of throwing when sender is missing.","Ensure programmatic invocations populate the command sender."],"tags":["minecraft","follow-plugin","command-validation","missing-argument"],"backgroundTag":null,"analyzedSha":"27111382b4a79a7e983289d6e983a06af185ed0f","analyzedAt":"2026-08-12T18:33:34.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}