const mineflayer = require('mineflayer');
const bot = mineflayer.createBot({
username: 'PaineNoPro',
host: 'vietmine.com',
port: 25565,
version: '1.8.9'
});
bot.once('spawn', () => {
bot.chat('/login xxxxxx');
console.log('Đã login thành công');
});
bot.on('chat', (username, message) => {
console.log(username + ': ' + message); // hien thi chat
if (message === 'test') bot.chat("This Works!");
if (message === 'join') {
setTimeout(() => {
bot.setQuickBarSlot(0);
console.log('Đã thiết lập hotbar');
}, 200);
setTimeout(() => {
bot.activateItem();
console.log('Đã kích hoạt item');
}, 4000);
setTimeout(() => {
bot.clickWindow(38, 0, 0);
console.log('Đã click vào ô 38');
}, 5000);
}
});
// Sự kiện khi bot tham gia server mới
bot.on('spawn', () => {
console.log('Bot đã tham gia server mới.');
});
// Sự kiện khi bot thoát khỏi server hiện tại
bot.on('end', () => {
console.log('Bot đã rời khỏi server.');
});
When I chat “test” in the lobby, it still responds. When I chat “join” it will go into skyblock (ie into another server). But when the “test” chat is in that skyblock, it doesn’t respond at all
I also tried ChatGPT but it doesn’t work. Looking forward to the experts looking for errors and guidance
New contributor
Jsj Kdkd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.