Jump to content

Trying to make mod with intellij, game saves and then crashes every time I try to open inventory


Snosib

Recommended Posts

So I've been following KaupenJoe's tutorial, specifically the one trying to add a block. Followed it exactly as far as I can tell, but it simply will not work. Client loads up fine, no issues, then i try to open my inventory and it just loses its mind. Game freezes, says saving game, then crashes. I just cannot find out what I did wrong. Says something is wrong with the build, but I didn't think I did anything with that at all. It worked perfectly yesterday when it was just 2 items. All I did is add the stuff for 1 block. 

https://pastebin.com/gjwuGL7R

Forge 1.20.1, JDK 17 Repository on GitHub: https://github.com/Snosib/Forge-Pigmano-1.20.X

Edited by Snosib
add github repository
Link to comment
Share on other sites

Here's your problem: line 24 in `src/main/java/net/citroncactus/pigmano/item/ModCreativeModeTabs.java`

pOutput.accept(ModBlocks.reinforced_concrete.get());


You're feeding this consumer a Block, not an Item. Creative Mode tabs only can register items. To fix this, make a BlockItem from your Block and plug the result of that here instead.

Something like this in ModItems.java:

public static final RegistryObject<Item> reinforced_concrete = ITEMS.register("reinforced_concrete",
            () -> new BlockItem(ModBlocks.reinforced_concrete.get(), new Item.Properties())) ;
Edited by dee12452
Code blocks instead of ticks
Link to comment
Share on other sites

Also, if you're planning on committing to mod development, might be a good idea to start being able to read your own crash reports. It'll save you a lot of time, and you don't have to come back here and wait for someone to respond lol. What I find to help is start by finding your own package name and look up and down from there. This is the place that helped me identify your problem. Good luck!

 detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
 
-- Head --
Thread: Render thread
Suspected Mod: 
	Pigmano (pigmano), Version: 0.1-1.20.1
		at TRANSFORMER/[email protected]/net.citroncactus.pigmano.item.ModCreativeModeTabs.lambda$static$1(ModCreativeModeTabs.java:24)
Stacktrace:
	at net.minecraftforge.common.ForgeHooks.lambda$onCreativeModeTabBuildContents$17(ForgeHooks.java:1631) ~[forge-1.20.1-47.2.20_mapped_parchment_2023.06.26-1.20.1-recomp.jar%23190%23197!/:?] {re:classloading}
	at net.minecraft.world.item.CreativeModeTab$Output.accept(CreativeModeTab.java:414) ~[forge-1.20.1-47.2.20_mapped_parchment_2023.06.26-1.20.1-recomp.jar%23191!/:?] {re:classloading,pl:accesstransformer:B}
	at net.citroncactus.pigmano.item.ModCreativeModeTabs.lambda$static$1(ModCreativeModeTabs.java:24) ~[%23196!/:?] {re:classloading}
	at net.minecraftforge.common.ForgeHooks.onCreativeModeTabBuildContents(ForgeHooks.java:1629) ~[forge-1.20.1-47.2.20_mapped_parchment_2023.06.26-1.20.1-recomp.jar%23190%23197!/:?] {re:classloading}

 

Link to comment
Share on other sites

On 3/14/2024 at 5:32 AM, dee12452 said:

Also, if you're planning on committing to mod development, might be a good idea to start being able to read your own crash reports. It'll save you a lot of time, and you don't have to come back here and wait for someone to respond lol. What I find to help is start by finding your own package name and look up and down from there. This is the place that helped me identify your problem. Good luck!

 detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
 
-- Head --
Thread: Render thread
Suspected Mod: 
	Pigmano (pigmano), Version: 0.1-1.20.1
		at TRANSFORMER/[email protected]/net.citroncactus.pigmano.item.ModCreativeModeTabs.lambda$static$1(ModCreativeModeTabs.java:24)
Stacktrace:
	at net.minecraftforge.common.ForgeHooks.lambda$onCreativeModeTabBuildContents$17(ForgeHooks.java:1631) ~[forge-1.20.1-47.2.20_mapped_parchment_2023.06.26-1.20.1-recomp.jar%23190%23197!/:?] {re:classloading}
	at net.minecraft.world.item.CreativeModeTab$Output.accept(CreativeModeTab.java:414) ~[forge-1.20.1-47.2.20_mapped_parchment_2023.06.26-1.20.1-recomp.jar%23191!/:?] {re:classloading,pl:accesstransformer:B}
	at net.citroncactus.pigmano.item.ModCreativeModeTabs.lambda$static$1(ModCreativeModeTabs.java:24) ~[%23196!/:?] {re:classloading}
	at net.minecraftforge.common.ForgeHooks.onCreativeModeTabBuildContents(ForgeHooks.java:1629) ~[forge-1.20.1-47.2.20_mapped_parchment_2023.06.26-1.20.1-recomp.jar%23190%23197!/:?] {re:classloading}

 

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