Offline to Online Switch on a Minecraft Server

Illustration

It all started with my kids learning about Minecraft skins and their dad not being able to get their new look working in the game. No matter what, they would stay Steve and Alex. Quick search told me skins are not supported in offline mode and my home server was setup as such. No worries I thought - I’ll just switch online-mode setting in [server.properties](http://minecraft.gamepedia.com/Server.properties) from false to true and that will be it.

However, after I restarted server, my whole family got to start from scratch. We were in skinned bodies but we were also in new locations. It was as if we logged onto the world for the first time. To make it worse, nobody had access to commands anymore. Our ops status has been effectively revoked.

As I added myself to ops again through Minecraft server GUI, I noticed that ops.json got two entries for my user name but each with different UUID. And I could find both UUIDs in my world’s save directory world\playerdata. That got me wondering. What would happen if I would delete file with new UUID and rename old UUID file to it. That is, if my old UUID was 76116624-b235-36a2-a614-ed79be1855ed and my new UUID was d8b2b4e0-1807-4177-a3ca-46afbd1d7538, would renaming 76116624-b235-36a2-a614-ed79be1855ed to d8b2b4e0-1807-4177-a3ca-46afbd1d7538 enable me to get back into my offline body?

Fortunately yes. Transplantation of player data succeeded without any issues. So I went through all save directories and changed played data from old to new UUID. But that wasn’t all. As we were all ops with different ops level for various worlds, I had to visit every ops.json and adjust for that. Simple search/replace was all it took.

And guess what, if you ever decide to make your server offline again, same annoyance in guaranteed since Minecraft has different UUIDs for online and offline mode. There simply seems no way around it. Later I found that people have even built tools to help them with rename.

As Minecraft requires you to verify your credentials at least once over Internet when you buy it, I cannot believe that there is technical reason behind this. Even more because this change was seemingly introduced only with version 1.7.6. My best guess is that it was added as some sort of anti-piracy measure. And as all such measures do, it ended up annoying more paying players than pirates.

In any case my, now online, server recovered from its temporary amnesia and digging could start again.

PS: Paranoid among us might want to check for UUIDs in whitelist.json too.