Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Bot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const mineflayer = require('mineflayer');

const bot = mineflayer.createBot({
host: 'tên-server.aternos.me', // đổi thành IP server của bạn
port: 25565, // để mặc định, hoặc sửa nếu server có port riêng
username: 'BotAFK' // Tên của bot (nếu là tài khoản cracked)
});

bot.on('chat', (username, message) => {
if (username === bot.username) return;
if (message === 'ping') {
bot.chat('pong!');
}
});