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

Hi,

 

I would like to add configurable item IDs in to my mod. I know how to make the file and things, but I looked around and found out you need the item declaration inside your @Init (load) method, but I can't do that because of achievements and a few other conditions (the functions that the achievements are in void methods themselves, like onItemPickup and stuff).

 

So, is there a way I could add configurable item ids without completely reformatting everything?

  • Author

Well, the file's there, but it keeps saying this in the console

 

2012-08-22 17:31:09 [iNFO] [sTDOUT] CONFLICT @ 0 item slot already occupied by net.minecraft.src.ItemSpade@62029d75 while adding com.rushmods.powermod.PowerModItemPickaxe@19af9e98

 

Even when the file's there and the property is, too. Here are the areas of interest:

 

private static int PickItemID;

 

public static final Item PowerPick = new PowerModItemPickaxe(PickItemID, POWER_TOOL);

 

@PreInit

public void preInit(FMLPreInitializationEvent event)

{

 

event.getModMetadata().version = Version.getVersion();

Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());

try {

cfg.load();

PickItemID = cfg.getOrCreateBlockIdProperty("PowerPickID", 9000).getInt(9000);

} catch (Exception e) {

 

} finally {

cfg.save();

}

}

 

And I get no errors but the one about the conflict, and the tool doesn't show up.

Soo.. you're loading the config in the PreInit

But you're creating your item in the static init...

How, exactly, did you expect that to work?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

Soo.. you're loading the config in the PreInit

But you're creating your item in the static init...

How, exactly, did you expect that to work?

 

Isn't that why I'm here?

-.-

Initialize your item AFTER you load your config!

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.