2024-09-07 07:43:08 -04:00
|
|
|
const mc = require('minecraft-protocol');
|
2024-10-12 08:11:35 -04:00
|
|
|
const ChatParse = require("./chatparser.js");
|
2024-09-07 07:43:08 -04:00
|
|
|
const bot = mc.createClient({
|
2024-10-12 08:11:35 -04:00
|
|
|
// host: '95.216.192.50', // kaboom
|
|
|
|
// host: 'chipmunk.land',
|
|
|
|
// host: '168.100.225.224', // Neko
|
2024-09-07 07:43:08 -04:00
|
|
|
port: 25565,
|
|
|
|
username: 'catparser', // cat
|
|
|
|
version: "1.20.4",
|
|
|
|
});
|
|
|
|
|
2024-10-12 08:11:35 -04:00
|
|
|
ChatParse.inject(bot); // load chatparser function
|
|
|
|
|
2024-09-07 07:43:08 -04:00
|
|
|
|
2024-10-12 08:11:35 -04:00
|
|
|
bot.on('custom_PlayerChat', (message, playerchat) => {
|
|
|
|
console.log(`PlayerChat: ${message}`);
|
2024-09-07 07:43:08 -04:00
|
|
|
});
|
|
|
|
|
2024-10-12 08:11:35 -04:00
|
|
|
bot.on('Custom_SystemChat', (message, systemchat) => {
|
|
|
|
console.log(`SystemChat: ${message}`);
|
2024-09-07 07:43:08 -04:00
|
|
|
});
|
|
|
|
|
2024-10-12 08:11:35 -04:00
|
|
|
bot.on('Custom_ProfilelessChat', (message, profilelesschat) => {
|
|
|
|
console.log(`ProfilelessChat: ${message}`)
|
2024-09-07 07:43:08 -04:00
|
|
|
})
|
|
|
|
|
2024-10-12 08:11:35 -04:00
|
|
|
/*
|
|
|
|
bot.on('Custom_AllChat', (message, chat) => {
|
|
|
|
console.log(`AllChat: ${message}`)
|
|
|
|
})
|
|
|
|
*/
|
2024-09-07 07:43:08 -04:00
|
|
|
bot.on('error', (err) => {
|
|
|
|
console.error('Bot Error:', err);
|
|
|
|
});
|