2024-09-07 07:43:08 -04:00
|
|
|
const mc = require('minecraft-protocol');
|
|
|
|
const inject = require("./chatparser.js");
|
|
|
|
|
|
|
|
const bot = mc.createClient({
|
2024-10-11 14:09:07 -04:00
|
|
|
host: 'chipmunk.land',
|
|
|
|
//host: 'kaboom.pw',
|
2024-09-07 07:43:08 -04:00
|
|
|
port: 25565,
|
|
|
|
username: 'catparser', // cat
|
|
|
|
version: "1.20.4",
|
|
|
|
});
|
|
|
|
|
2024-10-11 14:09:07 -04:00
|
|
|
inject.inject(bot); // load
|
2024-09-07 07:43:08 -04:00
|
|
|
|
2024-10-11 14:09:07 -04:00
|
|
|
bot.on('custom_playerChat', (msg, uuid, plainMessage, SenderName, TargetName, formattedMessage, unsignedContent, NoColorSenderName, NoColorTargetName, NoColorformattedMessage, NoColorunsignedContent, nocolorplayermsg, type) => {
|
2024-09-07 07:43:08 -04:00
|
|
|
console.log(`PlayerChat: ${msg}`);
|
|
|
|
});
|
|
|
|
|
|
|
|
bot.on('custom_systemChat', (msg, nocolormsg, jsonmsg) => { // SystemChat maybe is PlayerChat use sudo or vanish
|
|
|
|
console.log(`SystemChat: ${msg}`);
|
|
|
|
});
|
|
|
|
|
|
|
|
bot.on('custom_Commandspy', (cspy) => {
|
|
|
|
console.log(`CSPY: ${cspy.username}: /${cspy.command}`);
|
|
|
|
})
|
|
|
|
|
|
|
|
bot.on('error', (err) => {
|
|
|
|
console.error('Bot Error:', err);
|
|
|
|
});
|