moeru-ai/airi · warning · Error
Please specify a player name!
Error message
Please specify a player name!
What it means
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.
Source
Thrown at integrations/minecraft/src/plugins/follow.ts:49
if (!state.following)
return
const target = bot.bot.players[state.following]?.entity
if (!target) {
state.following = undefined
throw new Error('Player not found, stopped following')
}
const { x: playerX, y: playerY, z: playerZ } = target.position
bot.bot.pathfinder.setMovements(state.movements)
bot.bot.pathfinder.setGoal(new goals.GoalNear(playerX, playerY, playerZ, options?.rangeGoal ?? 1))
}
bot.onCommand('follow', (ctx) => {
const username = ctx.command!.sender
if (!username) {
throw new Error('Please specify a player name!')
}
startFollow(username)
})
bot.onCommand('stop', () => {
stopFollow()
})
bot.onTick('tick', () => {
if (state.following)
followPlayer()
})
},
}
}
View on GitHub (pinned to 27111382b4)
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.
Example fix
// before
// bot.onCommand('follow', (ctx) => {
// const username = ctx.command!.sender
// if (!username) { throw new Error('Please specify a player name!') }
// startFollow(username)
// })
//
// after (clearer usage + graceful message)
// bot.onCommand('follow', (ctx) => {
// const username = ctx.command!.sender
// if (!username) { logger.log('Usage: follow <player>'); return }
// startFollow(username)
// }) Defensive patterns
Strategy: validation
Validate before calling
// Validate sender before starting follow:
// const username = ctx.command?.sender
// if (!username) { logger.log('Usage: follow <player>'); return } Type guard
function hasSender(ctx: unknown): ctx is { command: { sender: string } } {
return !!ctx && typeof ctx === 'object'
&& !!(ctx as any).command && typeof (ctx as any).command.sender === 'string'
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: User types 'follow' instead of 'follow Steve'; command framework change that stopped populating sender; invoking the handler directly from non-command code.
Related errors
- no player name specified
- Player not found, stopped following
- Unknown action: ${step.tool}
- RESOURCE_MISSING
- TARGET_NOT_FOUND
AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12).
Data as JSON: /api/errors/79a665bfdc2746a9.
Report an issue: GitHub.