I have a hack mod. I found a random server, started to join it, then immediately it said something like "You have been banned for using a hacked client" and it didn't let me in. I have never seen this server before. I didn't have any hacks on. I don't have a mod cape. Can servers really detect my client, or did I mess up somehow? I have only gotten banned for hacking once, which was on a different server for sure.
We don't support the use of hacked clients on these forums. But yes, servers can easily detect hacked clients even if you don't have any hacks on. The easiest way to not get banned is to stop using hacked clients.
Bear in mind each server will operate under the rules created by the server owner/admin. Those rules are pretty independent from the rules here, so some servers will be a LOT more strict (and other far less so) than the Forums.