Skip to content

HANTALE-59/Discord-bot-Minecraft-Server-Management

Discord Bot: Minecraft Server Management

Work in Progress ⚠ This bot uses the new Minecraft Server Management Protocol (Java Snapshot 25w35a)

Quickstart Guide

  1. Set up your bot using the template instructions (starting at [How to Download It](
  2. When your bot is online, run the command: "prefix sync global" Replace prefix with your chosen bot prefix (e.g., $sync global). Then reload Discord
  3. Edit your Minecraft server's server.properties file and enable the management protoc management-server-enabled=true The default port 25585 is usually fine.
  4. Add your Minecraft server configuration to the bot via Discord: /mc add [name] IP Port
  • name: a friendly config name
  • IP: your Minecraft server IP (default: localhost)
  • Port: MSMP port (default: 25585)
  1. Link the bot with your running Minecraft server: /mc start [name] Avoi ça dans un bloc code comme ça je peux copier avec le smarkdowns et la mise en forme et tout This activates real-time event listening and notifications for that server in the Discord
  2. Use commands like /mc kick [player], /mc ops, /mc stop to manage your server rem

Features

  • Fully supports Minecraft Server Management Protocol commands and events.
  • Automatic notifications for player joins/leaves, bans, allowlist changes, server status
  • Add/remove servers dynamically.
  • Easy slash command interface with autocomplete.
  • Manage allowlists, bans, operators, gamerules, and server settings.

Support & Community

For help or questions:


Thanks

To kkrypt0nn for his amazing discord.py template wich allow me to save a lot of time. template-link

Python Discord Bot Template

Note

This project is in a feature-freeze mode, please read more about it here. It can be summed up in a few bullet points:

  • The project will receive bug fixes
  • The project will be updated to make sure it works with the latest discord.py version
  • The project will not receive any new features, unless one of the following applies:
    • A new feature is added to Discord and it would be beneficial to have it in the template
    • A feature got a breaking change, this fits with the same point that the project will always support the latest discord.py version

This repository is a template that everyone can use for the start of their Discord bot.

When I first started creating my Discord bot it took me a while to get everything setup and working with cogs and more. I would've been happy if there were any template existing. However, there wasn't any existing template. That's why I decided to create my own template to let you guys create your Discord bot easily.

Please note that this template is not supposed to be the best template, but a good template to start learning how discord.py works and to make your own bot easily.

If you plan to use this template to make your own template or bot, you have to:

  • Keep the credits, and a link to this repository in all the files that contains my code
  • Keep the same license for unchanged code

See the license file for more information, I reserve the right to take down any repository that does not meet these requirements.

Support

Before requesting support, you should know that this template requires you to have at least a basic knowledge of Python and the library is made for advanced users. Do not use this template if you don't know the basics or some advanced topics such as OOP or async. Here's a link for resources to learn python.

If you need some help for something, do not hesitate to create an issue over here, but don't forget the read the frequently asked questions before.

All the updates of the template are available here.

Disclaimer

Slash commands can take some time to get registered globally, so if you want to test a command you should use the @app_commands.guilds() decorator so that it gets registered instantly. Example:

@commands.hybrid_command(
  name="command",
  description="Command description",
)
@app_commands.guilds(discord.Object(id=GUILD_ID)) # Place your guild ID here

When using the template you confirm that you have read the license and comprehend that I can take down your repository if you do not meet these requirements.

How to download it

This repository is now a template, on the top left you can simply click on "Use this template" to create a GitHub repository based on this template.

Alternatively you can do the following:

How to set up

To set up the token you will have to make use of the .env.example file; you should rename it to .env and replace the YOUR_BOT... content with your actual values that match for your bot.

Alternatively you can simply create a system environment variable with the same names and their respective value.

How to start

The "usual" way

To start the bot you simply need to launch, either your terminal (Linux, Mac & Windows), or your Command Prompt ( Windows) .

Before running the bot you will need to install all the requirements with this command:

python -m pip install -r requirements.txt

After that you can start it with

python bot.py

Note: You may need to replace python with py, python3, python3.11, etc. depending on what Python versions you have installed on the machine.

Docker

Support to start the bot in a Docker container has been added. After having Docker installed on your machine, you can simply execute:

docker compose up -d --build

Note: -d will make the container run in detached mode, so in the background.

Issues or Questions

If you have any issues or questions of how to code a specific command, you can:

  • Join my Discord server here
  • Post them here

Me or other people will take their time to answer and help you.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Built With

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

About

Use the new Minecraft server management protocol introduces in Snapshot 25w35a.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published