Make a command called !helloworld that says Hello, World! when executed.
ex:
PHP Code:
else if (splitted[0].equals("!helloworld") {
mc.dropMessage("Hello, World!");
}
I want it like this.
Hmmm I'm going to make a command that generates commands (monster spawn)
like !addcommand spawn 100100 10 bob346
amkes a commadn that does !spawn 100100 10
and it names it bob346
edit
PHP Code:
else if (splitted[0].equals("!addcommand")) {
if (!splitted[1].equals("spawn")) return false;
int monsterId = Integer.parseInt(splitted[2]);
int quantity = Integer.parseInt(splitted[3]);
String name = splitted[4];
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO newcommands (monsterId, quantity, name) VALUES (?, ?, ?)");
ps.setInt(1, monsterId);
ps.setInt(2, quantity);
ps.setString(3, name);
ps.executeUpdate();
} catch (SQLException e) {
mc.dropMessage("Something bad happened.");
return false;
}
}
Yay
now help me select them when someone does !bob234 or whatever