#Getting Player by UUID
30 messages · Page 1 of 1 (latest)
it has to exist within minecraft itself, as offline mode is a thing
Wym
Do you mean there is no way to store the UUIDs and retrieve the username and info on the player?
no, player data is stored by uuid, and since those uuids still work in offline mode minecraft has to have something to convert that
hmm
though that might be because the client sends its uuid along with its name when joining
Yep. If you want you can check out my mod's source code since I'm storing player UUID to username.
Check out https://github.com/Xexplotion/Offline-Players/blob/1.21.1/src/main/java/net/xexplotion/offline_players/mixin/PlayerManagerMixin.java (particularly the disconnect method) and https://github.com/Xexplotion/Offline-Players/blob/1.21.1/src/main/java/net/xexplotion/offline_players/StateSaverAndLoader.java for saving the data persistently
You can't get player server side
like check for players that way.
On Player Join (Server) -> logs UUID and info
What?
Assuming the player had joined once you can get their username and if they haven’t you can easily make a lookup method to get it form their uuid with mojang api
I was just saying your using a mixin. But couldn't I just have the server get the player UUID, Username and then access that. Since it seems that their is not actually method todo this I'd need to create an api request to mojang?
Cause I also wanna pull their face texture
The mixin is basically the same thing as a PlayerJoinEvent, I didn’t understand what you meant sorry. If you just want to fetch their face texture it’s a “simple” request to the mojang api.
I even have some code that does exactly what you are trying to do (I think) that I could find lol
Do I need to use a mixin for the join event?
you could, and then store the uuids in a map of playername & uuid somewhere
or is there just an event the server could use? Since this mod really only works with a server its intended for multiplayer use
this is the simplest I can come up with
Did you read any of the code I linked? Mixins aren’t required but since I already mixined into the class I use one but you only need the player join event
I did
I may of overlooked I thought I saw a code linked to a mixin lol
Also if I correctly understand what you want then do you even need usernames?
.
I am going to display username, face texture and use uuid as the way to pull their information up
Ah
Also what reference is type? I check'd yours and didn't see a Type class with any of your imported namespaces.