You can do loads with accessibility between Discord bot and Minecraft server in a VPS, like:
Discord APIs:
Run these commands on your VPS to install Python, JavaScript, and Go (you need it to run your bot):
- Reading data from .dat files using NBT libraries
- Such as playerdata files and mineminenomi.dat (where fruit data is stored)
- Useful for gathering current whereabouts on devil fruits and other player stats
- Reading log files to detect certain events
Discord APIs:
Run these commands on your VPS to install Python, JavaScript, and Go (you need it to run your bot):
Code Editor
Code Editor
Code Editor
Then to run a Python bot (where the main filename is "main") run this in your VPS:
- python main.py
- python3 main.py
IMPORTANT
The following Python code examples assume the Discord bot is run from a folder in the root directory of the server.
So for example, the bot (Python file) is inside a folder called "my bot" (can call it anything) which is located alongside the "mods", "logs", "world", etc, folders
The following Python code examples assume the Discord bot is run from a folder in the root directory of the server.
So for example, the bot (Python file) is inside a folder called "my bot" (can call it anything) which is located alongside the "mods", "logs", "world", etc, folders
Whitelist players from Discord
Below is a Discord bot written in Python which whitelists players. If they're already whitelisted, it removes them instead.
REPLACE the serverIP, rconPass, and rconPort values with your own.
Note: you can also use mcr.command to run any command from your Discord server, using arguments from your Discord command. Get creative!
Get a players inventory items sent to Discord
Below is a Discord bot written in Python which gets the items in the inventory of a player, provided their exact Minecraft username
Reading mod names from a Minecraft server's files
Below is a very simple Discord bot written in Python which sends a list of all mods your server contains when the !mods command is called.
Code Editor