/slime_server

Control Minecraft server and more with Python Discord bot.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Control Minecraft server with Discord bot.

Scroll down for requirements, setup instructions and screenshots.

Features:

  • Basic commands: say, kick, teleport, save, weather, and gamemode.
  • Show connection history, chat log, online players, banned, OP list, and whitelist.
  • World save backup and restore system. Also has server folder backup/restore feature. These features need direct access to server files.
  • Server autosave, start, stop, status, version, log, update server.jar (only with Vanilla or PaperMC), and edit server.properties
  • Interface via RCON, Tmux or subprocess. Some features and command may be disabled if using RCON or Subprocess.

Requirements:

Python Modules:

Setup

  1. Create Discord bot using this portal.
  2. Setup Python venv and install libraries.
  3. Update slime_vars.py variables.
  4. Run python3 run_bot.py help, shows commands to setup tmux and/or run bot.
    python3 run_bot.py setup - Create required folders.
    python3 run_bot.py starttmux startboth attachtmux - Starts tmux session, bot and MC server, then attaches to tmux session.
  5. Use ?setchannel command to set channel id, so you get important bot/server event updates.
  6. Read through the help pages with ?help or ?help2 in Discord.
  7. Optionals:
    • Use ?serverscan command to add servers you manually put in the 'servers' folder.
    • You can use ?update to download latest .jar file (Downloads latest PaperMC by default, more details in slime_vars.py comments, line 63)

Using Virtualenv or venv:

Install Python3 venv:

sudo apt install python3-venv -y

Create Python Virtualenvt:

python -m venv ~/pyenvs/slime_server 

Activate new Python Virtualenv:

source ~/pyenvs/slime_server/bin/activate

Install required Python modules:

pip install discord.py discord-components asyncio file-read-backwards mctools requests bs4
or
pip install -r requirements.txt

Screenshots

Screen Shot 2021-12-04 at 22 33 54

Screen Shot 2021-12-04 at 22 57 41

Screen Shot 2022-04-12 at 6 59 20 PM