Posted May 4, 20205 yr Hi! i want to save a json file in the world save folder, how can i locate that folder client side? i know that getWorldName() exists, but Minecrafts allows to have multiple worlds with the same name but with different folders. An alternative could be creating a custom folder and delete it when the world gets deleted, is there any way to know when the world get deleted? For servers I am planning to use a custom folder. Cheers! ?
May 4, 20205 yr You can access it on the server side. Check if the World is an instance of ServerWorld. If it is, use ((ServerWorld)world).getServer().getFolderName(). If you don't check if the world is an instance of ServerWorld, then getServer() returns null on the client side.
May 4, 20205 yr Author I want to keep the mod client side, so i can't access the server side... i think?
May 5, 20205 yr What is the purpose of your mod? The server is responsible for save data, so the client doesn't have access to it on its own. In multiplayer, it wouldn't make sense for clients to have access to save information since the clients are effectively merely simulating the server-side world. Edited May 5, 20205 yr by imacatlolol I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.
May 5, 20205 yr I think you want the mod to be installed on the player's client, right? Even in Single Player, both a server side and client side run side-by-side. Like imacatlolol said, the client side doesn't access world information, even in single player. The method I pointed out will work in single player worlds by targeting the game's server side without having to be connected to a dedicated server. Edited May 5, 20205 yr by Azaka7
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.