I need a way to store a list of every player that joins my server, I have a stats system and when you run /stats (username) it will check if the username you entered has joined before so it can load the proper stats.
my ideas were saving a list variable, then looping through it but this will cause too much lag when thousands of players are entered in it, my other idea was to set a custom nbt tag to every player that joins and then the server checks if the player has the tag or not to determine if they have joined before. Are there any other methods that might be better?