Minecraft – Whitelist usernames in offline mode

minecraft-java-editionminecraft-java-edition-server

(I'm sorry for bad English, I'm not native speaker)

HOW CAN I SET WHITELIST IN OFFLINE MOD?

My Bukkit server in offline mod.

I tried to add an username in the game, for example, 'Bear' and used command '/reload'.

But in whitelist.json I saw 'bear' (with no capital). For sure Bear can't connect to server.

Then I turned off my server. In whitelist.json I changed 'bear' to 'Bear'. After this I run my server and in whitelist.json I saw 'bear'. Again.

Then I turned off my server. I deleted usernamecache.json. I run my server again. I added a new username in the game, for example, 'fox' and then '/reload'.

And what I saw in whitelist.json? 'FoX' and 'bear'!

Well, I turn off my server, I opened whitelist.json again and changed 'bear' to 'Bear' and 'FoX' to 'fox'. I turned on my server. After this usernames didn't changed: I saw 'Bear' and 'fox'. But this players still can't connect to my server.

To be honest, I don't remember very well sequencing, but I really tried to write it as accurate as it possible.

Best Answer

First, you should not run your server in offline mode.

However, if you have to, you need to add whitelist entries by UUID and not by name. Because server automatically looks to Mojang.com for UUIDs by the name you wrote. So it will be always online=true UUID. Online UUIDs =/= offline UUIDS.

All you need is to get offline UUID, there are some webpage tools for that, for example our servers have this tool on webpage, : http://tools.glowingmines.eu/ , or you can let the people login and you can see their UUID in console, or they will generate their own player.dat in format of UUID.dat in world folder.

However in offline mode, be sure you have some another thing to protect your server, because any pirated launcher can change name of player, so anybody with the correct name can join. Typical use for that is AuthMe.

Note: you did not wrote your minecraft version, so I assume you use newest or at least NOT TOO OLD one.

Note 2 : Capital letters do NOT matter in UUID generation.