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

I am having difficulty with my mod in getting the UUID of an offline player from their name. How can I do this? I am using forge version 1.12.2 - 14.23.1.2555.

•Fact: Updating a mod to a new version of minecraft takes time. Especially if the original mod was never open source.

•Fact: The more users pester people who make mods to update their mods to a new version of minecraft, the less likely it is that it will be quickly updated.

•Fact: The more you comment about it, the more likely you are to be ignored.

•Fact: The more recent the last post about updating a mod is, the more annoying yours will be.

•Fact: Using all caps does not reverse any of the above effects

I don't know if it's possible to get from UUID from offline player (I haven't tried it before) but you can save player uuid to configuration file when he logged in server first time, and you can check his nickname from configuration file. If I remember correct, playerLoginEvent or LoggedIn event could be suitable for this.

11 hours ago, diesieben07 said:

An offline player by definition has no real UUID. There is code to create some fake UUID based on the name, but this is terrible, since the UUID will then change once they are online again (this will make the player's pets forget their owner, etc.).

 

You should not play offline :P

Maybe the OP is talking about player's that are not present on the world or players that are not really logged on?

Edited by Differentiation

  • 2 weeks later...
  • Author

I mean the UUID that is used to keep stuff like inventory when you change your username and track previous names.

 

By  offline I mean they are not on the server. Not that they pirated the game or something.

 

I figured it out. Make an HTTP GET request to https://api.mojang.com/users/profiles/minecraft/username?at=time, but replacing the username and time with the actual username and time. the ?at= portion is not required. It returns the UUID and the name they had at the given time, in JSON format. You can go there with your own name to check this. 

Edited by DaComputerNerd

•Fact: Updating a mod to a new version of minecraft takes time. Especially if the original mod was never open source.

•Fact: The more users pester people who make mods to update their mods to a new version of minecraft, the less likely it is that it will be quickly updated.

•Fact: The more you comment about it, the more likely you are to be ignored.

•Fact: The more recent the last post about updating a mod is, the more annoying yours will be.

•Fact: Using all caps does not reverse any of the above effects

  • 3 weeks later...
  • Author
On 1/28/2018 at 7:35 AM, diesieben07 said:

You should use PlayerProfileCache::getGameProfileForUsername instead, which will only make a request to the API if needed and cache results.

Good to know. Finding documentation was difficult.

My mod stores the data during runtime anyways, and makes the request when the command is run and the player is not found in the hashmap. 

•Fact: Updating a mod to a new version of minecraft takes time. Especially if the original mod was never open source.

•Fact: The more users pester people who make mods to update their mods to a new version of minecraft, the less likely it is that it will be quickly updated.

•Fact: The more you comment about it, the more likely you are to be ignored.

•Fact: The more recent the last post about updating a mod is, the more annoying yours will be.

•Fact: Using all caps does not reverse any of the above effects

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.