Code (Text): if (Bukkit.getPlayer(playerName) == null) { sender.sendMessage("Player does not exist!"); }
Straight from the docs: getPlayer(String name) Gets a player object by the given username. getPlayer(UUID id) Gets the player with the given UUID. getPlayerExact(String name) Gets the player with the exact given name, case insensitive.
Code (Text): if (Bukkit.getOfflinePlayer(playerName) == null) { sender.sendMessage("Player does not exist!"); }