Create Minecraft bots for version 1.5.2
Use the package manager npm to install minesquire.
npm install minesquire
const minesquire = require("minesquire");
var bot = new minesquire.Bot({
username: "Bot",
host: "localhost",
port: 25565
});
bot.on("login", () => {
console.log("Logged in");
});
bot.on("chat", (message = "") => {
console.log(`[Message] ${message}`);
});
bot.on("kicked", console.log);
bot.on("error", console.log);