This is basically a fork of https://github.com/RayNieport/mconBot, a bit updated, and with better "security" (made in collaboration with ChatGPT ;).
- i've only "moved over" the simple python version, not the docker image
- main python file a bit updated for discord's new standards (this means adding the init shit)
- removing commands.json, now the bot just runs whatever command you give it, no different role management (user, mod, admin)
- now using the /send slash command (with ephemeral response)
- insted of role names, now using discord user IDs
mconBot allows you and your friends to easily control your Minecraft server from the comfort of Discord! Minecraft servers use a protocol called RCON to accept remote commands. If you're hosting your own server, you may have seen RCON mentioned in the server.properties file.
However, using RCON has some issues:
- Port forwarding RCON to control your server over the internet is not very secure.
- The RCON "user" has permission to run the full suite of Minecraft commands, without any restrictions.
- There is only one RCON "user", so your friends can't log in to moderate the server unless you give them the credentials for unrestricted RCON access.
To solve these problems, mconBot does the following:
- Uses Discord as an interface to eliminate the need for port forwarding or a VPN (mconBot is intended to be hosted on the same LAN as your Minecraft server).
- Solves permission issues using a three-tiered system of Users, Moderators, and Administrators. Higher tiers allow more sensitive commands to be executed.
First, enable RCON by editing the server.properties file of your Minecraft server:
enable-rcon=true
rcon.password=<your passord>
rcon.port=25575
broadcast-rcon-to-ops=<optional, true|false>
Second, clone the git respository to the machine you want to run the bot on:
git clone https://github.com/w4sb0y/minecraft-rcon-discord-bot
Third, install python 3 , then navigate to the cloned repository and install the necessary dependencies:
pip3 install -r requirements.txt
Fourth, create your instance of the bot at the Discord Developer Portal:
Fifth, modify mconBot/src/.env in the cloned repository:
- Paste the Discord Token aquired above into the appropriate field.
- Fill in your Minecraft server's IP and RCON password. If you're not using the default RCON port (25575), you can also change that.
- Change the discord user ID(s) to be able to use the bot.
Sixth, head into src/ in the cloned repository and start up the bot:
python3 bot.py




