Guide

How to make a Discord bot for a Minecraft server

Updated October 7, 2026

Most Minecraft communities live on Discord. A bot can show whether the server is online and how many players are on, take whitelist requests, post announcements or relay chat. You can write one with discord.py (Python) or discord.js (Node.js).

An example to start from.

Generate this with Codexe

Step by step

  1. 1.Create the application

    In the Discord Developer Portal create an application, add a bot and copy its token. Invite it to your server with the permissions it needs.

  2. 2.Decide what it does

    For example: /status shows online/offline and players by querying the server, a status message updated every minute, a /whitelist request that staff approve with a button.

  3. 3.Write the bot

    Slash commands, the server query (the Minecraft server list ping for status, RCON for commands) and a config file for the address and channels.

  4. 4.Host it

    The bot must run all the time: on a VPS, a bot host or the same machine as the server. Keep the token in a .env file, never in the code.

With Codexe

Describe the bot and choose discord.py or discord.js. Codexe writes the bot and its config, checks that it installs and starts, and you can run it from Codexe to try it with your token before downloading it.

Questions

Can the bot run commands on the Minecraft server?

Yes, through RCON if it is enabled on the server, or through a small plugin that talks to the bot.

Make the bot for your server

This prompt opens ready to send:

“A discord.py bot for a Minecraft server: /status shows online or offline, players online and version by pinging the server address from config, a status message in a channel updated every minute, and /players lists who is online.”

Generate this with Codexe
How to make a Discord bot for your Minecraft server | Codexe