Add index.js

This commit is contained in:
m_c_player 2024-09-04 20:13:03 -04:00
commit 399464f763

14
index.js Normal file
View file

@ -0,0 +1,14 @@
const mf = require('mineflayer');
const bot = mf.createBot({
host: process.argv[2],
port: parseInt(process.argv[3]),
username: "EvalBot"
});
bot.on('chat', (uname, msg, jsonMsg) => {
if(msg.startsWith("/eval")) {
try { bot.chat(`${eval(`${msg}`.slice("/eval ".length))}`); } catch(err) { bot.chat(`${err}`); };
}
console.log(msg)
});