MCBotJS | Your scriptable chat bot solution
0.5.0MCBotJS is a powerful and easy to use chat-bot creator utilizing JavaScript.
MCBotJS
MCBotJS is a one of a kind chat bot creator. Utilize your JavaScript skills to quickly deploy custom bots with loads of features using the MCBotJS API.
The plugin is and will continue to be in active development, so there may lack some features you'd like to see. If you want to recommend a feature for the API, please mention this in the discussion tab.
Commands
/mcbot reload - Reloads all configs and scripts
Configuration
Configure your bots in the configuration like so. The script section is a reference to a js file in the scripts/ directory within the MCBot/ plugin directory.
This is just an example, further configs can be found in the documentation by following the guides.
bots:
Bot1:
name: '&4ExampleBot'
script: 'example'
Example Bot
Example Bot Code
With the example config, place the example code into a MCBot/scripts/example.js file
// Event which handles incoming chat messages
function onMessageSend(bot, message) {
// Retrieve the content of the message and the player who sent it
var content = message.getContent();
var player = message.getPlayer();
// Perform different actions based on the content of the message
switch(content) {
case "!hello":
// Send a greeting message to the player who sent the command
bot.sendMessage("Hello " + player.getName());
break;
case "!getRandomWord":
// Make an HTTP GET request to fetch a random word from an API
var response = bot.get("https://random-word-api.herokuapp.com/word");
// Parse the JSON response
var responseJSON = JSON.parse(response);
// Send the random word to the server chat
bot.sendMessage(responseJSON);
break;
}
}
// Event which handles player join events
function onPlayerJoin(bot, player) {
// Construct a welcome message for the server
var message = "";
if(player.hasPlayedBefore()) {
message = "Welcome back " + player.getName();
} else {
message = "Welcome " + player.getName();
}
// Send the welcome message to the server
bot.sendMessage(message);
}Development Documentation: https://mcbotjs.atlassian.net/wiki/spaces/UM/overview
If you need any help with the api, or if you run into any bugs please ask in the discussion tab, or join the discord server
Similar projects
Script →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta