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.
Example Bot
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
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.
Code (YAML):
bots:
Bot1:
name : '&4ExampleBot'
script : 'example'
Bot1:
name : '&4ExampleBot'
script : 'example'
Spoiler: Example Bot Code
With the example config, place the example code into a
MCBot/scripts/example.js file
Code (Java):
// 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 ) ;
}
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
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.20, 1.20.6
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
MCBotJS | Your scriptable chat bot solution is a free Minecraft Java mod. Compatible with Minecraft 1.20, 1.20.6. Downloaded 395 times (via Spigot). Download it and open it directly in the game.