var readline = require('readline');
var mineflayer = require('mineflayer');

var rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
	terminal: false
});

function print_help() {
	console.log("usage: node minechat.js <hostname> <user> <password>");
}

if (process.argv.length < 5) {
	console.log("Too few arguments!");
	print_help();
	process.exit(1);
}

process.argv.forEach(function(val, index, array) {
	if (val == "-h") {
		print_help();
		process.exit(0);
	}
});

var bot = mineflayer.createBot({
  host: process.argv[2],
  username: process.argv[3],
  password: process.argv[4]
});

rl.on('line', function(line) {
	bot.chat(line);
});

bot.on('chat', function(username, message) {
  console.log(username + ": " + message);
});

@@ -498,118 +498,467 @@
 var 
-bo
+hos
 t = 
-mineflayer.createBot(%7B%0A  host: process.argv%5B2%5D,%0A  username: process.argv%5B3%5D,%0A  password: process.argv%5B4%5D
+process.argv%5B2%5D;%0Avar port = 25565;%0Avar user = process.argv%5B3%5D;%0Avar passwd = process.argv%5B4%5D;%0A%0Aif (host.indexOf(':') != -1) %7B%0A%09port = host.substring(host.indexOf(':')+1);%0A%09host = host.substring(0, host.indexOf(':'));%0A%7D%0A%0Aconsole.log(%22connecting to %22 + host + %22:%22 + port);%0Aconsole.log(%22user: %22 + user);%0Aconsole.log(%22passwd: %22 + Array(passwd.length).join('*'));%0A%0Avar bot = mineflayer.createBot(%7B%0A%09host: host,%0A%09port: port,%0A%09username: user,%0A%09password: passwd
 %0A%7D);
@@ -1061,10 +1061,9 @@
 ) %7B%0A
-  
+%09
 cons

Split hostname and port