Using Coordinates
"How can I get a unique ID for every world / server / realm / etc to store my data under"
Last updated
"How can I get a unique ID for every world / server / realm / etc to store my data under"
Last updated
Coordinates are Java records that contain an ID based on the connection, and a generated human-readable name. Some may also contain extra data such as a singleplayer world's directory name, or a multiplayer server's address.
Singleplayer / LAN host
singleplayer/New World
Singleplayer: New World
LAN (remote player)
lan/Herobrine - New World
LAN:
Multiplayer Server
multiplayer/mc_hypixel_net
Multiplayer:
Realm Server
Minecraft Realms: Builder's Palace
A common use point might be on server connect, such as in Fabric's ClientPlayConnectionEvents#JOIN
:
Coordinates aren't available duringClientPlayConnectionEvents#DISCONNECT
- you may want to save the one you use loading data alongside the data itself. You can see this being done in the .