commit 399464f763220ff9f66f1a8513637d23f2df0aa0 Author: m_c_player Date: Wed Sep 4 20:13:03 2024 -0400 Add index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..30fad16 --- /dev/null +++ b/index.js @@ -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) +}); \ No newline at end of file