I tried to create a Script that connects to a offline Server sends a Message and immediatly disconnects. Im currently looking to get the reason, why the client is disconnected. Basically in order to check if the username is banned or the client failed to Authenticate with minecraft.net
var mc = require('minecraft-protocol');
var client = mc.createClient({
host: "192.168.178.22",
port: 80,
username: "test",
});
client.on('connect', function() {
console.info("connected");
});
client.on('end', function(reason) {
console.info(reason);
response.end();
console.log("---ENDED----");
});
client.on(0x01, function() {
client.write(0x03, { message: "dsasda",});
setTimeout(function() {
client.end();
console.log('disconnected');
return;
}, 1);
});