I've a problem about typing confirmation. I'm doing Virtual Spawner plugin.
If player has enough money and typing Y his spawner gonna upgrade to Lvl2.
My question is how can I do this Y or N confirmation? I thought with AsyncPlayerChatEvent. But this time every Y or N trigger Upgrading.
public static void jlvlup(Player player,int currentLevel) {
String lvlup2= ChatColor.DARK_RED+"Do you confirm upgrade spawner to Level 2 for 5000000$ ?(Y/N) Write to chat.";
if(currentLevel==1) {
player.sendMessage(lvlup2);
player.closeInventory();
}
}