I've lately been wondering if it was possible to make a sword (or other weapons) that bans the player being hit from the server permanently. I tried searching it on Google, with a few different phrases, but to no avail. I found nothing. It seems no one else in the history of ever wants to know. Is there a chain of command blocks I could write, or some mod I could install for my server?
/ban comamnd, which would be used to ban people on a server, cannot be used in command blocks or any other means of automatically running commands.
You can, however, use command blocks to emulate the effect of banning a player, see How can I block people from my Minecraft world? for details.