ban_player
Ban players from a Minecraft server to enforce rules and maintain a safe gaming environment. Specify player name and optional reason for moderation.
Instructions
Ban a player from the server.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player | Yes | Player name | |
| reason | No | Ban reason |
Implementation Reference
- src/tools/player-tools.ts:115-139 (handler)The ban_player tool is registered and implemented in src/tools/player-tools.ts using the server.tool method. It takes a player name and an optional reason, then sends a 'ban' command via RCON.
server.tool( "ban_player", "Ban a player from the server.", { player: z.string().describe("Player name"), reason: z.string().optional().describe("Ban reason"), }, async ({ player, reason }) => { const cmd = reason ? `ban ${player} ${reason}` : `ban ${player}`; try { const response = await manager.rcon.send(cmd); return { content: [{ type: "text", text: response }] }; } catch (error) { return { content: [ { type: "text", text: `Failed: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } );