This is a simple plugin that hides player name tags and shows them on actionbar on right click.
Just download a JAR and place it into plugins
folder.
See plugins/NametagHider/config.yml
for configuration reference.
A Spigot plugin that hides player nametags and shows them on right click
JavaMIT