Changing Online Mode without losing inventory?

Hey boys.
I’m currently hosting a Pixelmon server and I started it in Online mode=false because one of my bestfriends (who helped me build most of it) didnt have official minecraft. Now he bought it and I’m looking to change to online mode=true.
Saddly when I do the UUIDs change and every loses claims, pex, pixelmons, inventories, etc…
Is there a fast/smart way to do this?
Would manually changing the UUIDs in the player data folder work?
I can ask people to reclaim their lands and store their stuff on chests but It’s really hard to gather every1s pokemon one by one.

Thanks in advance.

Honestly I don’t think there’s an easy way to tackle this task. Someone else might have a trick up their sleeve though.

It’s mostly because of Pixelmon losses. I can simply delete Polis data and ask them to store everything in chests and claim again… And redo pex for staff

A feasible solution a can think of is caching the players info when they log in in offline mode, and once everyone’s been cached, transfer all the data. I’m not sure if this is possible to do with pixelmons data though…

If you are patient enough…

You should already have a list of the players who joined in offline mode due to their data being saved in various places: their uuid-filenames for player data, and in corresponding plugins, and hopefully atleast one plugin that will let you match a name to the uuid file that you can read (stored in plaintext vs binary data)

Extract the list of all playernames from the server, just their names, assuming that their used name matches their online name (if you know of specific exceptions, ie your friend that is special to you, had been unable to buy the name he wanted to use, but you know what he will use, then make that substitution in the list). Put each name in a simple text file, one name per line, called whitelist.txt

Then create a temporary vanilla minecraft server in a new folder on your computer (without worrying about port forwarding issues etc), that is in online mode. I dont know if this trick will work with the current vanilla servers or not, i suspect it should, but you may need to go through the minecraft assets location to get a 1.7.6 to 1.7.10 version: After starting the server, stopping, doing the eula agreement, starting, letting it generate files, then stopping again… delete the whitelist.json file it creates, and transfer your whitelist.txt file into that folder. Then restart.

The server will automatically try to convert the list of raw names in the whitelist.txt file into a paired list of names and online uuid numbers for every entry - if you have more than a thousand names, you will need to chop your list up into various files and repeat this process separately for each.

In the end, you will have whitelist.json file that have the online UUID found for each playername from the names in your current list - there may be many offline players who do not have an account that transfers and for which their uuid could be found, and they will be listed as exceptions not found in your server logs. You are now done with this temporary server.

Now using this Online UUID <<===>> NAME <<===>> Offline UUID data mapping that you can produce, you can rename every UUID-based filename in each plugin folder, each UUID in each file-list, each UUID in each database table. Strongly advised: Keep a copy of the original offline data, and make another copy of the server data files to do the manipulation on (and/or make a copy of the database tables before modifying). If you have programming skills to make some scripts or programs to do the extraction of the data from the files, from the folders, and to do the renamings then it will be a lot easier to stepwise set those up and make the changes. If you only have 15 or so players for the server, then manually making each change is a slow, repetituious, but manageable task…

The existing offline server may also have a usercache.json file that uses offline UUIDs for each player, giving you one of the offlineUUID<<==>>name matchups, but I dont know if it does do that for offline mode.

Just make sure to get every possible uuid-filename modified to the online uuid, every file that may use permissions and ranks and has player uuids, every database table with the new uuids, and keep note as to which ones didn’t automatically transfer so that you can later manually change all the unchanged files for that person if you can personally verify who they are…

Once you have all your modified datafiles made, purge the corresponding files from your server and replace with the modified ones, purge the op/ban/whitelist/cache json files, switch to online mode, and fire it up. Then if their names are the same as their online names, they’ll login with the same permissions, inventory, homes, money, whatevers, in the same location as before. Except for the folks whose uuid info couldn’t be found in the online UUID lookup, they will login as default brand new users. If you can somehow confirm their id to their old offline name, you can then go through your copies of the offline-mode server to modifiy the filenames, and when your real server is TURNED OFF add those files to it (which should overwrite the newly created file they got from logging in), and carefully modify your database tables and any files that contain the uuid to match the one corresponding to their correct uuid, grant them the requisite permissions as before…

Its a lot of work to do it right, esp if you have a lot of locations to change, but your players will adore you for your efforts. If you have under 20 users, and not too many complicated places to change the files, and no coding skills, its a manual effort that will be tiring, but, its straight-forward enough to do carefully and methodically as long as you do everything in the same order and go systematically though each thing.

What may complicate things is when you run into some points where you get a uuid that has no hyphens in it, and are expected to store it in the form with hyphens, or vice versa. Again, with a modest list its not hard to take a file of hyphenless uuids, make a copy, and manually add the hypens in the right spot - they always follow a spacing pattern - using a fixed width font like Courier when working with that data will greatly simplify placement since all the characters should line up visually and you’ll spot if you accidentally deleted a character or inserted a hyphen in the wrong spot.

At minimum you need time and a clear head, a plain text editor like Notepad or Notepad++ and NOT wordpad etc that save bit formatted files or its equivalent mac editor if youre an apple user; and a spreadsheet program wouldn’t hurt to help keep track of correlations, patience, caution, and perseverance to make all the modifications in the correct format without breaking files. How long it will take depends on how many places you need to change, and how many users to do. Add programming skills to that and it may even take longer to do, but you have the benefit of pushing a button and doing a whole set of files at once absolutely correctly with 0 chance of a typo, yet if you mess up something while developing that script you merely delete the working datafiles, and start with another copy, until that script works correctly. But if your playercount is in the several hundreds and higher, via script is about the only practical way to do it.

1 Like