anarchy-bots
v50.2.0
Published
Creates an anarchy bot for anarchy servers
Downloads
33
Readme
Overview
anarchy-bot is a framework that allows you to make bots inside Minecraft anarchy servers!
Features
Interaction creator: A function that lets you make interactions for the bot
Built-in chat parser: A built-in plugin that parsers chat messages for you
Examples
Here is an example code for you:
const {
anarchyBotCreator,
anarchyBotInteractionCreator
} = require('anarchy-bots');
const anarchyBot = anarchyBotCreator.createAnarchyBot({
targetHostname: 'localhost',
targetPort: 25565,
botUsername: 'Bot',
botVersion: '1.18.2',
commandPrefix: '!'
});
anarchyBot.on('signingIn', information => {
console.log(`Signing in to '${information.targetHostname}:${information.targetPort}'...`);
});
anarchyBot.on('signedIn', information => {
console.log(`Signed in to '${information.targetHostname}:${information.targetPort}'!`);
});
anarchyBot.on('signedOut', information => {
console.log(`Signed out from '${information.targetHostname}:${information.targetPort}' due to: ${information.dueTo}`);
});
anarchyBotInteractionCreator.createInteraction(
anarchyBot,
{
type: 'command',
name: 'ping',
execute (commandHandler) {
commandHandler.anarchyBot.anarchyClient.write('chat', { message: 'Pong!' });
}
}
);
anarchyBotCreator.signInAs(anarchyBot);