inviting friends to your server minecraft java
Emily Wong
Published May 05, 2026
I know that if you create a single player and then change it into a server you can invite your friends to play together, but i wanted to know if i can change the settings so that only my friends who i invited are allowed to join. Just incase someone ramdomly found my server and went inside to destroy everything, if you know the answer, please reply, thank you :3
41 Answer
First, use whitelist on to enable the whitelist, which will only allow specified players to join.
You can add players to the whitelist using whitelist add <targets>
<targets> is defined as:
Must be a collection of game profiles (player profiles), which can be a player name (must be a real one if the server is in online mode), or a player-type target selector. Specifies the player profile(s) to be added to or removed from the whitelist.
From the wiki