Jump to content

How to get world save folder name as string?


X66Herobrine66X

Recommended Posts

I need a very simple procedure that will return the name of the world folder in windows explorer as a string. I don't know much about coding Minecraft mods as I use MCreator but I'm learning Java in college and have a technical aptitude. I tried this but it just returned the world name.

package com.angelofcreation.creativebackport;

import net.minecraft.world.level.LevelAccessor;

public class GetWorldName {
    public static String execute(LevelAccessor world) {
        return world.getServer().getWorldData().getLevelName();
    }
}

 

Link to comment
Share on other sites

19 hours ago, X66Herobrine66X said:

I don't know much about coding Minecraft mods as I use MCreator

We don't support MCreator here.

19 hours ago, X66Herobrine66X said:

but I'm learning Java in college and have a technical aptitude

Learn Java completely first. Without doing so, you'll likely be confused on most explanations given on this forum since we assume a decent level of Java knowledge is known by modders.

19 hours ago, X66Herobrine66X said:

I need a very simple procedure that will return the name of the world folder in windows explorer as a string

Why do you want this? You should not need to do anything in the world folder.

19 hours ago, X66Herobrine66X said:
package com.angelofcreation.creativebackport;

Since this is a backport, do you have permission to backport this mod from the author (or at least have it from a permissible license)?

Link to comment
Share on other sites

On 2/25/2023 at 12:10 PM, ChampionAsh5357 said:

We don't support MCreator here.

Learn Java completely first. Without doing so, you'll likely be confused on most explanations given on this forum since we assume a decent level of Java knowledge is known by modders.

Why do you want this? You should not need to do anything in the world folder.

Since this is a backport, do you have permission to backport this mod from the author (or at least have it from a permissible license)?

"We don't support MCreator here.
Learn Java completely first. Without doing so, you'll likely be confused on most explanations given on this forum since we assume a decent level of Java knowledge is known by modders."

Not what I asked, but ok.

"Why do you want this? You should not need to do anything in the world folder."

Why does it matter?

"Since this is a backport, do you have permission to backport this mod from the author (or at least have it from a permissible license)?"
It's not a backport that's just the directory of the java file I'm writing in. I just opened whatever random project I had open to write the code in. And, once again, it's not what I asked.

Link to comment
Share on other sites

5 hours ago, X66Herobrine66X said:

Not what I asked, but ok.

I mean...it's kinda important since we don't support MCreator help, so it would be rude to not provide support and not tell you why.

5 hours ago, X66Herobrine66X said:

Why does it matter?

Because, as I said, there's no reason for you to directly touch the world folder itself. There are plenty of other systems that allows you to write/read arbitrary data without it.

5 hours ago, X66Herobrine66X said:

It's not a backport that's just the directory of the java file I'm writing in. I just opened whatever random project I had open to write the code in. And, once again, it's not what I asked.

Apologies for the misunderstanding, but again, it doesn't matter the question if there is a better way to solve it or we don't support it.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.