Personely I would pick the energy sword because it’s so fun to use and rly easy to kill other players with and if you fight someone else with an energy sword you just end up getting knoecked back and not dieing like you would with a gravity hammer
Between the two? Sword all day. Sure, a hammer can technically counter it...assuming they know I'm around. I usually play CQC assassin-style if those are my only two options. I prefer a shotgun over both if given the option.
Sword. Specifically Prophet's Bane while crouching in the corner of an enemy base. I don't even attack, I just sit there and watch the enemies' confusion trying to figure out just where the hell the attacker is.