public void typeString(String s, boolean enter) throws InterruptedException {
for (char c : s.toCharArray()) {
bot.getKeyboard().typeKeyEvent(c, 0);
}
if (enter) {
client.typeKey((char)KeyEvent.VK_ENTER, 0, 0, false);
}
}
Send key events yourself manually. Credits to @Zach.