A Discord bot to control a Minecraft Bedrock server remotely.
Project description
CraftLink
A Discord bot to control a Minecraft server remotely.
Examples
Starting, Stopping, Sending Commands (Bedrock and Java)
Command /say
from In-Game POV
Security Disclaimer
While there is some validation around the commands sent to the server, it is important to note that it is likely not secure.
It is very possible that this could be abused to send and execute malicious code!
Recommended Restrictions
Since this connection gives full control over a Minecraft server and it's various properties and settings, the bot requires and is limited to a single Discord channel within a Discord server.
It is recommended this channel be private and limited to only server admins and moderators.
Granular permissions based on Discord role may come eventually...!
Setup
Operating System
Currently Windows only simply because that's where my server is living... but planning to bring to Linux, too!
Dependencies
Requires Python 3.9+.
Install via pip install craftlink
.
Or, clone and run poetry install
to install from source.
You'll need to download the Bedrock Server, or the Java server.
You'll probably want to run your server manually first to configure your world. You can migrate an
existing local world to be a server pretty easily by copying the world data into
<server_directory>/worlds
(Bedrock), or replacing the <server_directory>/world
folder (Java).
Running
To run the server, just invoke craftlink
with the necesary arguments/environment variables set.
Required arguments:
-t
,--discord-bot-token
,DISCORD_BOT_TOKEN
- Token to use to authenticate the Discord bot.-c
,--discord-channel-id
,DISCORD_CHANNEL_ID
- Discord channel ID to target the bot's messages to.-d
,--server-install-directory
,SERVER_INSTALL_DIRECTORY
- Directory that the server executable is in.-y
,--server-type
,SERVER_TYPE
- Type of server to be run ("bedrock" or "java"), defaults to bedrock.-m
,--java-memory-min
,JAVA_MEMORY_MIN
- (Java only) minimum server memory to allocate, defaults to 1024.-x
,--java-memory-max
,JAVA_MEMORY_MAX
- (Java only) maximum server memory to allocate, defaults to 1024.
Improvements
- Add tests.
- Add user roles at the bot level to restrict certain actions.
- Could be multiple roles such that "admins" have all perms, "mods" have less, and "users" have none or just
/say
.
- Could be multiple roles such that "admins" have all perms, "mods" have less, and "users" have none or just
- Be cool if this could run in a container altogether.
- Support for modded server launchers.
Affiliate Disclaimer
In no way affiliated with Microsoft or Mojang (that'd be dope though, feel free to reach out, folks).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for craftlink-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24c9763bc1ca8148a9d12e089a7706c7ed1726c4d3eee119b31ab6a2b90cc34f |
|
MD5 | 4f28bac137714cdaf2cdf92f876a95cc |
|
BLAKE2b-256 | 8e94491c0b411270fe1ae8f4c12389112e532ef81eeae742cef596df274643e6 |