This document is for v2.2. Download here.
Do you want a Discord Bot to start and manage your Minecraft server? This program will help you do just that!
This script can start your Minecraft server from a Discord command and will shut it down automatically when inactive! Users can get information about the server such as its address and online players. If the address changes, users can request a new address and the bot will get one automatically! It can also integrate your Discord and Minecraft servers' chats!
For the server host, this program works entirely using vanilla methods, meaning you don't have to add any mods to your Minecraft server!
/start
will start the Minecraft server if it's not already running./stop
will shut down the Minecraft server if no players are online./info
will give you the server information./ipcheck
will check the server address given in/info
. The bot will try to update the server address on its own if the address doesn't work./say <message>
will send a message in the Minecraft server if it's running. The message will appear as{username#0000} <message>
. This command is still usable, but is discouraged in favour of a new and better feature./help
can be used to get information on these commands on Discord.
/cmd <command>
will execute a Minecraft command. For example,/cmd time set 0
. The bot will respond with the output, in this caseRcon: Set the time to 0
./ipset <address> <port>
will take a new server address and check it. If it's valid, the bot will start using that address moving forward. Providing a new port is optional: the bot defaults to the current server port. This will be reset when the bot restarts.
Follow these steps:
Do this part ONLY IF you are setting this up for the first time! v2.1 requires you to redo this section.
Go to the Discord Developer site, and create a new application. Now go to the "Bot" section and build a bot.
Head over to the "OAuth2" section, and under it, the "URL Generator" section. Under "Scopes", check bot
and applications.commands
.
Under "Bot Permissions", select the permission "Administrator". At the very bottom, there will be a "Generated URL".
Copy it and paste it in your browser. This will allow you to invite your bot to your server.
If you haven't already, set up your Minecraft server on your machine as normal. Now go to your server.properties
file.
Change the following values:
enable-rcon=true
rcon.password=<password>
, where <password> is the password you wish to use for Rcon.
Open the file named bot.env
.
- Paste your Discord bot token next to
bot-token
. - Paste the server address that other players would use to connect next to
server-address
. - Paste the server start script next to
start-script
. (For example,start-script=java -Xmx2G -Xms512M -jar server.jar
) - Paste the user ID of the account that shall be allowed to execute commands through Rcon next to
server-op
. If you want multiple users, separate each one with,
. For example:server-op=123,456,243,632
. Do not use spaces. - For
chat-channel-id
, refer to the Discord server setup section.
Create a new channel for the Discord-Minecraft chat integration.
Copy its ID and paste it under chat-channel-id
.
If you want multiple channels, simply separate each ID with ,
, similar to server-op
. Do not use spaces.
- Minecraft connects to port 25565 by default. If you forward any port other than 25565, your address would look something like
xxx.xxx.xxx.xxx:port
since the port must also be specified for Minecraft. This CAN be set inbot.env
, in which case the program pings the server onport
. However, if you use port 25565, you may leave the address asxxx.xxx.xxx.xxx
and the program will use port 25565 automatically. - The Minecraft -> Discord integration works off the fact that messages sent by players show up as
<player> message
in the console. Therefore, any mods that change the chat format are very likely to break this feature. However, it is definitely worth trying such mods since there is a chance that some of them may work normally.