#1.21.5 World UUID

33 messages · Page 1 of 1 (latest)

burnt patio
#

Anyone know of a way to get some type of UUID for whatever world the client is in? Whether that be a client world or server world? Can't seem to find anything on the yarn mappings reference for the World class.

elfin ibex
#

get the registry key of the world and then the identifier contained within it

burnt patio
elfin ibex
#

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)

burnt patio
#

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

elfin ibex
#

what

#

the end, the nether and the overworld are 3 different worlds each with their own id

burnt patio
#

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.

elfin ibex
#

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

burnt patio
#

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

elfin ibex
#

you can probably attach a data attachment to the level.dat

burnt patio
#

will that work for multiplayer though? since the client won't necessarily have access to the file?

elfin ibex
#

why do you need to store per save data on the clientside

#

no

#

it won't

burnt patio
#

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.

elfin ibex
#

you can't store data like that without a lot of jank

burnt patio
#

idk seems like minimap etc have been able to do it but its closed source so i can't find out how lol

elfin ibex
#

you can use the server ip on multiplayer and the internal save name on singleplayer

#

but the ip can change

burnt patio
#

yeah that's what i was thinking

burnt patio
#

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

sweet nebula
#

@burnt patio use cardinal components or something

#

to store data on the world