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

What I'm doing during the FMLInitializationEvent:

GameRegistry.addSmelting(BlockInit.tenebraeOre, new ItemStack(ItemInit.tenebraeChunk), 0.5F);

 

What happens when I join a world:

 

java.lang.NullPointerException

at net.minecraft.item.ItemStack.getMetadata(ItemStack.java:281) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

at net.minecraft.item.crafting.FurnaceRecipes.compareItemStacks(FurnaceRecipes.java:114) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

at net.minecraft.item.crafting.FurnaceRecipes.getSmeltingResult(FurnaceRecipes.java:100) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

at net.minecraft.item.crafting.FurnaceRecipes.addSmeltingRecipe(FurnaceRecipes.java:88) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

at net.minecraft.item.crafting.FurnaceRecipes.addSmelting(FurnaceRecipes.java:80) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

at net.minecraft.item.crafting.FurnaceRecipes.addSmeltingRecipeForBlock(FurnaceRecipes.java:72) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

at net.minecraftforge.fml.common.registry.GameRegistry.addSmelting(GameRegistry.java:225) ~[forgeSrc-1.9-12.16.0.1832-1.9.jar:?]

 

Any reason for this? I think it has something to do with TenebraeOre not having an Item version but it shouldn't need one, and I can't see any vanilla ore having an item version.

Vanilla ores do have item versions, that's how you hold them in inventory after breaking them (perhaps with silk-touch). As with most blocks, their items are derived automatically, so they're hard to find in the code. Read down toward the long list of item instances in the Item class, and you''ll see lines such as:

 

        registerItemBlock(Blocks.gold_ore);
        registerItemBlock(Blocks.iron_ore);
        registerItemBlock(Blocks.coal_ore);

 

I suspect that you've got a cart before a horse somewhere. We need to see more of your code, like where/when are your inits called to populate the fields you're using in the one line you showed us? If you're using a field before you set it, then that would explain your NPE.

 

PS: What does "chunk" mean in your statement? Chunk has a special meaning in Minecraft coding, so I suggest avoiding it.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.