#1.21.5 World UUID
33 messages · Page 1 of 1 (latest)
get the registry key of the world and then the identifier contained within it
Do you mean like this? It doesn't seem to have any unique info, just the dimension
Identifier worldUUID = client.world.getRegistryKey().getValue();```
that is your unique id
worlds don't have uuids anymore tmk
idek if they ever had uuids, I think that only exists in bukkit (and it's derivatives)
not exactly what im looking for then. this value is the same even after changing worlds so im not sure how i would be able to differentiate between two different worlds
what
the end, the nether and the overworld are 3 different worlds each with their own id
ohh i see the confusion. i mean literal world saves, not dimensions
i want to be able to identify which of these worlds i am currently in, multiplayer servers included.
each save has an internal name iirc
you can use that, but querying info will require looping each save each time
what are you trying to do
sounds like xy problem possibly
im saving data per world
similar to like minimap mods etc with waypoints, same idea just different data
so ill have some file with the data per world, but i cant seem to find a way to identify what world the player is in using the ClientWorld
you can probably attach a data attachment to the level.dat
will that work for multiplayer though? since the client won't necessarily have access to the file?
going back with the waypoint example, if i save one way point at some x, y, z to a file. I want to be able to read that back once i close the game and return to the world.
you can't store data like that without a lot of jank
idk seems like minimap etc have been able to do it but its closed source so i can't find out how lol
you can use the server ip on multiplayer and the internal save name on singleplayer
but the ip can change
yeah that's what i was thinking
for anyone else wondering, the Bobby mod has a good example of this. Idk about other versions but for 1.21.5, there is an IntegratedServer field on the client instance (getServer()) for single player, as well ClientPlayNetworkHandler that can get server info (getServerInfo()) which can be used to find world names/server names