A Python-based Discord bot that monitors a Minecraft Java server in real time and posts live status updates in a Discord channel. The bot shows whether the server is online or offline, displays the number of players online, lists their usernames, and attaches the server's icon.
- Real-time status updates: Checks server status every 30 seconds.
- Online/Offline/Empty detection: Shows different embed colors and messages based on server state.
- Player list display: Lists the names of online players (if available).
- Server icon support: Displays the Minecraft server's icon in the embed. Place your
server-icon.pngin root directory whereMinecraft_Server_Status_Discord_Bot.pyis located. - Efficient updates: Only sends updates when something changes (status, player count, player list, or icon).
- The bot connects to your specified Discord channel.
- It posts an embed message with the current Minecraft server status.
- Every 30 seconds, it pings the server:
- If the server is offline → Red embed with "Server is Offline".
- If the server is online with no players → Purple embed with "Server is Online".
- If the server is online with players → Green embed listing the players.
- Updates the embed only if something changes.
- Uses the server icon.
- Python 3.8+
- discord.py (latest stable)
- mcstatus
- Discord bot token
- Discord channel ID
- Message ID (for editing the same message, otherwise the bot will create new messages every 30 seconds)
- Minecraft server IP and port
server-icon.pngin root directory (whereMinecraft_Server_Status_Discord_Bot.pyis located)
-
Clone the repository:
git clone https://github.com/yourusername/minecraft-server-status-discord-bot.git cd minecraft-server-status-discord-bot -
Install dependencies:
pip install discord.py mcstatus
-
Create the following files in the same directory:
TOKEN→ Write your Discord bot token (e.g., aefia7332t4y324f2wgu2) in it, nothing else, no spaces, no new lines.MC_SERVER_IP→ Write your Minecraft server IP with port inip:portformat in it (e.g., play.example.com:25565).CHANNEL_ID→ Write in it your Discord channel ID where status should be posted.MESSAGE_ID→ Do not create this file if no existing message is present to edit. If the first message is posted, you can copy that's ID and write in it so that could be edited onwards.server-icon.png:Place your Minecraft server icon asserver-icon.pngin the bot's directory, replacing the existing one.
python Minecraft_Server_Status_Discord_Bot.pyThe bot will create or update a status message in the given Discord channel.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Created by: Ayan Khan
Email: [email protected]