online-mode is a setting in server.properties. When it's true (the default), your server checks with Mojang that every player owns Minecraft and really is the account they say they are.
Keep online-mode=true. Turning it off ("offline mode" or "cracked") is the single biggest security risk you can take on a Minecraft server.
What happens if you turn it off
- Anyone can join as anyone, including you. Someone can connect using your username, get your op powers, and ban everyone or delete the world.
- Bans stop working properly, because players can rejoin with any name they like.
- Skins break. Players appear with default skins because the server no longer knows their real accounts.
- Player data can get mixed up. Inventories and plugin data are linked to account IDs, which change when online mode changes. Switching it back and forth can make players lose their items and progress.
The one good reason to turn it off: a proxy
If you run a network with Velocity or BungeeCord, the backend servers have online-mode=false, because the proxy handles logins. This is only safe when:
- The proxy itself has online mode on.
- Player info forwarding is set up. For Velocity, use modern forwarding with a secret shared between the proxy and each Paper server. For BungeeCord, set
bungeecord: true in spigot.yml.
- Players can't connect to the backend servers directly, only through the proxy.
If you're not running a proxy, there's no reason to turn online mode off. If someone has asked you to so they can join without buying Minecraft, the safe answer is no. Bedrock players can join with Geyser and Floodgate instead, without offline mode (see "How do I let Bedrock players join with Geyser and Floodgate?").