Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Is there something I can call inside code to return the default minecraft pathname ?

 

I need to save some subfolders and files subfolders and I want to be able to easily get to the /Mods/<ModName> directory.

 

What is good practice Mod practice if you have to do this ? (e.g. create the base directory for and save files for the mod would be Mods/<Modname>  ?

 

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

My utility:

 

public static File getMcDir()
{
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer())
{
	return new File(".");
}
return Minecraft.getMinecraft().mcDataDir;
}

 

Note: Returns /.minecraft/ for client and /server_folder/ for dedic.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

My utility:

 

public static File getMcDir()
{
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer())
{
	return new File(".");
}
return Minecraft.getMinecraft().mcDataDir;
}

 

Note: Returns /.minecraft/ for client and /server_folder/ for dedic.

 

Just what the doctor ordered !  :)

 

I'll add that to my generic utililty stuff....

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

I'm also assuming (dangerous I know) that I use the /Mods directory and make a sub directory of that with my mod name as a place to hold my needed folders.

 

If this is wrong, please let me know :D

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

If I don't use a subfolder off of the Mod folder where do I put the default folder for the mod ?

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

Its a place where I put files that my mod generates (which can have a few subfolders if neccesary).

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

My mod generates data that needs to be saved so it can be recalled later (structures etc), so  basically user generated text files and potential subfolders with those files in it.....

 

So, to restate clearer:

 

Where do you put user generated files (generated by the mod) so that they don't clobber something else ?

 

It would seem to make sense to put is as a subdirectory to your mod where ever you place your mod files, but , if not there, then where is the best place to put these (as a named subdirectory off the root would seem kind of  inappropriate) ?

 

 

 

 

 

 

 

 

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

This is like REALLY mod-specific question. You can put data anywhere you want.

 

I personally do it in /.minecraft/MyModFoler/myData.something

 

Diesieben just said that your /mods/ should not contain anything other than mods.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

So I'll put it in a folder of my own creation of the root....

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

Can you please clarify ? I don't see a "world" folder under my minecraft (I am running a few mods now)....

 

If you mean by a save file, then it is not specific to that particular world per se but used by the mod to generate stuff.....

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

  • Author

Then this thread is truly resolved then :D

 

I hope it is of use to any future modders......

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.