Skip to content

w4sb0y/minecraft-rcon-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

minecraft-rcon-discord-bot

This is basically a fork of https://github.com/RayNieport/mconBot, a bit updated, and with better "security" (made in collaboration with ChatGPT ;).

Main changes from the original mconBot:

  • 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

General description (from mconBot):

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:

  1. Port forwarding RCON to control your server over the internet is not very secure.
  2. The RCON "user" has permission to run the full suite of Minecraft commands, without any restrictions.
  3. 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:

  1. 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).
  2. Solves permission issues using a three-tiered system of Users, Moderators, and Administrators. Higher tiers allow more sensitive commands to be executed.

How does it work:

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:

  1. Paste the Discord Token aquired above into the appropriate field.
  2. 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.
  3. 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

Some example images:

img img img img img

About

This is basically a fork of https://github.com/RayNieport/mconBot, a bit updated, and with better "security".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages