Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey, I made a quick explanation of Minecraft UUID auth system implemented in 1.7.

If you're interested in how it works, read further.

 

 

 

> Since 1.7 came out, there's a "GameProfile" assigned to every player now. You can get GameProfile of a player by using EntityPlayer.getGameProfile(). Yeah, with that said, you probably still wonder how does Minecraft UUID system work. Let me start explaining that.

 

>>>>>>>>>>>>>>>>>>>>>>>> DISCLAIMER! <<<<<<<<<<<<<<<<<<<<<<<<

>> 1. English is not my main language, I could make mistakes

>> 2. I could be wrong.

 

1. UUID in Java

> There's a concept of Universally Unique Identifier. If you're not familiar with it, try reading that*. If you have no time (too lazy) to read it, I'm going to cut a long story short here. UUID is an ID made out of 128 bits (16 bytes, 2 longs). It's called "unique" because the random number generator used when doing UUID.randomUUID() is very strong. According to wikipedia "only after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%", so yeah, pretty strong. UUIDs can be converted to hexadecimal string and backwards. They can also be generated from any amount of bytes as a random seed(UUID.nameUUIDFromBytes(byte[])), that's what Minecraft uses to get UUIDs from account / nickname.

 

2. Getting UUID from player's account

> There's a UUID assigned with every Minecraft account. When the player enters the game, session id, as well as account UUID, is provided in program arguments. Then it converts into a real UUID by using UUID.fromString(arg). This UUID will be sent to the server when the played connects to it, identificator is also used in constructor of a GameProfile (new GameProfile(UUID, username)).

 

3. Getting UUID from an offline player

> Remember, I mentioned UUID.nameUUIDFromBytes(byte[])? Minecraft generates an offline UUID from bytes of string "OfflinePlayer:<nickname>", in other words: "UUID.nameUUIDFromBytes(("OfflinePlayer:" + getName()).getBytes(Charsets.UTF_8)". That's why when you change "online-mode" in settings.properties, everyone loses their inventories and player infos. UUID is changed, so it leads to another file in "playerdata" folder of your world.

 

That's probably all the explanation of this whole UUID auth system.

 

Source:

> Me researching minecraft sources while I'm modding

 

* https://en.wikipedia.org/wiki/Universally_unique_identifier

 

 

 

Permanent link:

bit.ly/minecraftuuid

  • 4 months later...

This UUID will be sent to the server when the played connects to it,

 

You said 'played' instead of 'player'. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.