I am trying to make the bot attack everything it sees, but it gets kicked for trying to hit something out of it's reach, here is my code
var settings = {
username: 'testingbot',
host: 'localhost',
port: 25565,
};
const bot = mineflayer.createBot(settings);
var killer_mode = true;
bot.on("move", () => {
let friend = bot.nearestEntity();
if (friend) {
bot.lookAt(friend.position.offset(0, friend.height, 0));
bot.setControlState('sprint', killer_mode)
bot.setControlState('forward', killer_mode)
}
if (killer_mode) {
bot.attack(friend)
}
});
I tried adding if friend into if (killer_mode), idk what I thought that would do