This pack will let you toggle players names on and off using functions or events (whatever you prefer). This can be very useful on a lot of different types of servers.
This behaviour pack can let you toggle the names of players in your game, you can turn every players name on and off using the functions /function show and /function hide as shown:
Or you can change individual players names using /event entity @ name:hide/show.
This behaviour pack can be useful on certain maps, servers or worlds, here are the screenshots with hide and show: