28 lines
862 B
JavaScript
28 lines
862 B
JavaScript
const mc = require('minecraft-protocol');
|
|
const inject = require("./chatparser.js");
|
|
|
|
const bot = mc.createClient({
|
|
host: 'chipmunk.land',
|
|
//host: 'kaboom.pw',
|
|
port: 25565,
|
|
username: 'catparser', // cat
|
|
version: "1.20.4",
|
|
});
|
|
|
|
inject.inject(bot); // load
|
|
|
|
bot.on('custom_playerChat', (msg, uuid, plainMessage, SenderName, TargetName, formattedMessage, unsignedContent, NoColorSenderName, NoColorTargetName, NoColorformattedMessage, NoColorunsignedContent, nocolorplayermsg, type) => {
|
|
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);
|
|
});
|