Control your bot using Discord slash commands or in-game commands.
- Discord Integration: Control the bot using slash commands.
- In-Game Commands: Manage the bot directly from Minecraft using chat commands.
- Modular Command System: Easily extend the bot's functionality by adding new command modules.
- Pathfinding & PvP: Uses
mineflayer-pathfinderand@nxg-org/mineflayer-custom-pvpfor movement and combat. - Chat Relay: Relays in-game chat to a Discord channel using a webhook.
-
Clone the repository:
git clone https://github.com/OBNinjaa/mineflayer-discord-bot.git cd mineflayer-discord-bot -
Install dependencies:
npm install
-
Installing fonts
- Make sure to install the font at data/mineglyph-faithful.ttf
-
Create a
settings.jsonfile in the root directory of the project or run configure.bat. -
Add the following configuration options to
settings.jsonfor example:{ "username": "MineBot", "host": "localhost", "port": 25565, "version": "1.20.4", "auth": "microsoft", "token": "MzA4MjkzNjAzNTMxMjkyNjcy.DN9r_A.brcD2xRAqjAGTuMcGPwy4TWVQdg", "managers": ["OBNinjaa", "Pix3lPirat3"], "prefix": "$", "webhook": "https://discord.com/api/webhooks/1429455926922055720/WVNbCPJnjgDZVA-XQmgSdgO0AL5cc8gX1spMkF3DRavrGmeBB6R5zrgw", "can_send_messages": true, "can_run_commands": true, "show_coordinates": true }username: The Minecraft username for the bot.host: The IP address of the Minecraft server (e.g.,localhost).port: The port of the Minecraft server (e.g.,25565).version: The Minecraft version of the server.auth: The authentication method ('microsoft' or 'offline').token: Your Discord bot's token.managers: An array of Minecraft usernames that are allowed to control the bot in-game.prefix: The prefix for in-game commands (e.g.,$).webhook: The URL of the Discord webhook for chat relay.can_send_messages: Iftrue, the bot can send messages in Minecraft chat.can_run_commands: Iftrue, the bot can execute Minecraft commands (e.g.,/gamemode).show_coordinates: Iftrue, the bot's coordinates will be shown in certain commands.
-
Register Discord Commands: Before the first run, you need to register the slash commands with Discord's API. Then refresh your Discord client in order to see the commands.
npm run register
-
Start the Bot:
npm start
- Discord slash commands are located in the
commands/directory. - Each subdirectory in
commands/represents a command category.
- In-game commands are located in the
modules/directory. - These commands can be executed by
managersin the Minecraft chat using the configuredprefix.
-
The bot has a delivery command used in mostly anarchy server.
-
You can configure the chest positions in data/storage.
-
You must make sure the bot has a bed near the chests so it can access them once it spawns.
[ { "x": 6, "y": -60, "z": -6 }, { "x": 5, "y": -60, "z": -6 }, { "x": 4, "y": -60, "z": -6 }, { "x": 3, "y": -60, "z": -6 }, { "x": 2, "y": -60, "z": -6 } ]