plugins | ||
.gitignore | ||
index.js | ||
LICENSE | ||
package.json | ||
README.md | ||
utils.js |
Plobot
A Minecraft bot built using Mineflayer designed for Kaboom clones, capable of accomplishing various tasks (duh).
Features
- Automatic Head Movements: It can stare at nearby players, wowzies!
- Custom Behaviors: Easily add your own custom logic or extend the bot’s functionality through the plugin system, all without affecting anything unrelated!
- Event-driven: Listens to Minecraft events such as player interactions, block updates, etc.
- Infinitely Programmable: With the built-in Scheme interpreter and the Scheme initialization file, you can (theoretically) craft any intricate user-defined commands in-game through chat, without even touching a line of bot code!
Requirements
- Node.js: Just grab the newest version, whatever it is.
- Mineflayer: This bot is powered by the Mineflayer library.
Installation
We'll assume you are using *NIX for this one, like most people do when hosting a bot. These instructions haven't been checked, so please take it with a grain of salt (but I believe they're mostly correct).
-
Clone this repository:
git clone https://code.chipmunk.land/Plovie/plobot.git cd plobot
-
Install dependencies:
npm install
Configuration
There isn't a lot of configuration for this bot, but if you look at the code, you'll find something like this:
const bot = require('mineflayer').createBot({
host: process.argv[2] || 'play.kaboom.pw',
port: process.argv[3] || 25565,
username: process.argv[4] || '_dat',
checkTimeoutInterval: 600 * 1000,
plugins: plugins,
hideErrors: true
});
bot.prefix = process.argv[5] || ';';
You can specify those 4 options, either through command-line arguments or by modifying the code directly, and I don't think I even have to explain what each of them means. Do I? Anyway, here's an example.
node index.js mykaboomclone.com 25569 Notch '!'
Usage
Start the Bot
To start the bot with default configs, run the following command:
node index.js
The bot will attempt to log in to the specified server and start performing the configured tasks.
Custom Commands (Plugins)
The bot already comes with a bunch of built-in plugins. To add custom behaviours or commands, create a new directory in the plugins
folder and add a new index.js
file in there. The bot will automatically load all plugins found in the plugins
directory. Here's an example (not tested, should work anyway):
mkdir plugins/myPlugin
touch plugins/myPlugin/index.js
And then you add some code to plugins/myPlugin/index.js
. Assuming your bot is stored in the variable bot
, you can add your own help topics coupled to the plugin by modifying bot.help
. Here's an example of plugins/myPlugin/index.js
(modified from plugins/prefixManager/index.js
):
const inject = bot => {
bot.help.someRandomTopic = () => `Hello! I'm some random help topic! And hey, the bot's prefix is ${bot.prefix}!`;
bot.on('whisper', (username, message) => {
if (!message.startsWith('prefix')) return;
const words = message.split(' ');
if (words.length === 1) {
bot.whisper(username, `Current prefix: ${bot.prefix}`);
} else {
bot.whisper(username, `New prefix: ${bot.prefix = words[1][0]}`);
}
});
}
module.exports = inject
Troubleshooting
- Bot failed to connect to the server: Ensure that the Minecraft server is running and the bot knows the correct host and port, etc.
- Missing files: There are a couple of files needed by the bot for it to be fully functional. You can study the source code to see how things work, and add the files manually (contents of files might matter, too). If you don't add the files, the basic functionalities of the bot should still be unaffected, though.
License
Will you read that LICENSE file?