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

I'd like to read some arbitrary files related to my mod. Specifically, these will be images and JSON config files. (I'm aware of the Forge config file format, but it's not suitable for my use case. So JSON it is.)

 

These will not be save-specific files. I.e. they should be global to the Minecraft installation. So I'm thinking they would go somewhere in minecraft/config/NameOfMyMod.

 

First, is this OK? Second, is there an API method I can call which will return the path to my mod's config folder? Once I have that path, I'll be able to read and parse the JSON data.

 

Third, will it be possible use images in the config folder as textures? If not, is there any way to achieve something similar? Essentially, I want my mod to be able to use user-supplied textures. I'd rather not force users to open the .jar file and put them there.

 

If necessary, I'd be willing to read the image data from the files myself, and pass that image data to an API method.

 

I'm targeting MC 1.5.2.

Config files are already doing this, so yes it is OK.

Loader#getConfigDir();

 

As for images/textures. Resource packs are now a built-in feature of Minecraft. That means users don't have to open your jar. They only need to make a resource pack following your jar structure and add whatever textures they want to change.

  • Author

Thanks! I've been reading conflicting info on what version of MC introduced resource packs. Are they available in 1.5.2?

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.