
Online UUID Fix
This mod intercepts UUID assignment at login and fetches the real UUID from the Mojang API, falling back to the vanilla offline UUID for offline accounts or when the API is unreachable.
About this Mod
Online UUID Fix
Warning: Always back up your entire world folder before installing this mod or performing any UUID migration. UUID changes affect player data, advancements, stats, and pet ownership. There is no automatic rollback.
Note: This mod's code was generated with the assistance of AI (Claude by Anthropic). Use it at your own risk and review the code before deploying on a production server.
A Fabric server-side mod for offline-mode servers that assigns players their real Mojang/Microsoft UUID instead of the vanilla offline UUID.
When a server runs in offline mode (online-mode=false), Minecraft generates a UUID from the player's username using a local hash. This means the same player gets a different UUID than they would on an online-mode server, breaking compatibility with player data from online servers and causing issues when players switch usernames.
This mod intercepts UUID assignment at login and fetches the real UUID from the Mojang API, falling back to the vanilla offline UUID for non-Mojang accounts or when the API is unreachable.
Requirements
- Minecraft 1.21.11
- Fabric Loader 0.18.2+
- Server-side only — does not need to be installed on clients
Installation
- Download
modid-1.0.0.jarfrom the releases or build it yourself (see below) - Drop it into your server's
mods/folder - Start the server — no configuration needed
The mod will log resolved UUIDs on first login:
[OnlineUuidFix] Resolved Steve -> xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
UUID lookups are cached to config/online-uuid-fix/uuid-cache.json so the Mojang API is only called once per username.
Building from source
Requirements: JDK 21 (Eclipse Adoptium — install the JDK, not JRE)
# Windows — set JDK if you have both JDK and JRE installed
$env:JAVA_HOME = "C:\Program Files\Eclipse Adoptium\jdk-21.0.10.7-hotspot"
./gradlew build
Output jar: build/libs/modid-1.0.0.jar
Migrating an existing server to online UUIDs
If your server already has player data stored under offline UUIDs, you need to rename those files to the correct online UUIDs, otherwise players will start fresh.
Player data is stored in:
world/playerdata/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.dat
world/advancements/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.json
world/stats/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.json
Step-by-step migration
1. Find each player's offline UUID (the current filename)
The file is named after the UUID the server assigned. List world/playerdata/ to see all files.
2. Find the player's real online UUID
Look it up at namemc.com or use the Mojang API directly:
https://api.mojang.com/users/profiles/minecraft/<username>
The id field in the response is the UUID without dashes — insert dashes in the pattern 8-4-4-4-12.
You can also use the calculator at:
https://minecraft.wiki/w/Calculators/Player_UUID
3. Rename the files
With the server stopped, rename each file:
world/playerdata/<offline-uuid>.dat → world/playerdata/<online-uuid>.dat
world/advancements/<offline-uuid>.json → world/advancements/<online-uuid>.json
world/stats/<offline-uuid>.json → world/stats/<online-uuid>.json
4. Start the server with this mod installed
New logins will now receive the online UUID, which matches the renamed files.
What migration does NOT cover
Pets and tamed animals
Pet ownership is stored inside the pet's NBT data as the owner's UUID. After renaming player files, pets will still reference the old offline UUID and won't recognize the player as their owner.
There are two ways to fix this:
Option A — In-game command (server must be running)
Stand next to the pets and run:
/execute as @e[type=wolf,distance=..10] run data modify entity @s Owner set from entity @p UUID
This reassigns ownership of all wolves within 10 blocks to the nearest player. Replace wolf with other pet types (e.g. cat, parrot, horse) and adjust the distance as needed.
Option B — NBTExplorer (server must be offline)
Use NBTExplorer to edit world NBT data directly:
- Search for the old offline UUID string in region files
- Replace each occurrence with the new online UUID
Advancements
Advancements are stored in separate .json files (not inside .dat). These also need to be renamed — see step 3 above.
Other players' inventories
If you need to copy a player's inventory to another player (e.g. merging accounts):
- Back up both
.datfiles - Copy and rename the source player's
.datto the target player's UUID - The target player will then have the source player's inventory, XP, and position
This will not transfer pet ownership — see the note above.
How it works
The mod injects into net.minecraft.core.UUIDUtil.createOfflinePlayerUUID via a Mixin. Every time the server would generate an offline UUID from a username, the mod first queries the Mojang API (api.mojang.com/users/profiles/minecraft/<name>). If a result is returned, that UUID is used instead. If the API returns 404 (no Mojang account) or is unreachable, the original vanilla offline UUID is used as a fallback.
Available Versions
How to Install Online UUID Fix on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.11).
Install Mod
Open the mod browser in the dashboard and search for "Online UUID Fix". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
1.21.11
Server-side
✓ RequiredRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
Online UUID Fix server crashes on startup – what to do?
Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.11). You can switch loaders with one click in the panel.
Is Online UUID Fix compatible with fabric?
Online UUID Fix officially supports fabric for Minecraft 1.21.11. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with Online UUID Fix – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Online UUID Fix consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install Online UUID Fix with just one click on your server.