Jump to content

Recommended Posts

Posted

For some reason, when starting the game with my mod, it almost instantly crashes. The weird thing is, that it used to work before, but I don't know what I changed that's causing it.

Here's the full crash report:

---- Minecraft Crash Report ----
// Who set us up the TNT?

Time: 9/13/17 4:57 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from null (welcomer)
Caused by: java.lang.RuntimeException
	at net.minecraftforge.fml.common.LoadController.buildModObjectList(LoadController.java:289)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:225)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604)
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266)
	at net.minecraft.client.Minecraft.init(Minecraft.java:508)
	at net.minecraft.client.Minecraft.run(Minecraft.java:416)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.12.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_101, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 2012434184 bytes (1919 MB) / 2560098304 bytes (2441 MB) up to 3817865216 bytes (3641 MB)
	JVM Flags: 2 total; -Xmx4g -Xms2g
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.41 Powered by Forge 14.22.1.2479 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State | ID        | Version      | Source                           | Signature |
	|:----- |:--------- |:------------ |:-------------------------------- |:--------- |
	| U     | minecraft | 1.12.1       | minecraft.jar                    | None      |
	| U     | mcp       | 9.19         | minecraft.jar                    | None      |
	| U     | FML       | 8.0.99.99    | forgeSrc-1.12.1-14.22.1.2479.jar | None      |
	| U     | forge     | 14.22.1.2479 | forgeSrc-1.12.1-14.22.1.2479.jar | None      |
	| U     | welcomer  | 1.3          | Welcomer                         | None      |

	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 385.41' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'

And the game log:

[16:56:42] [main/INFO]: username: [email protected]
[16:56:42] [main/INFO]: Extra: []
[16:56:42] [main/INFO]: Password found, attempting login
[16:56:42] [main/INFO]: Logging in with username & password
[16:56:43] [main/INFO]: Login Succesful!
[16:56:43] [main/INFO]: Running with arguments: [--userProperties, [], --assetsDir, C:/Users/Koen/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --userType, mojang, --accessToken{REDACTED}, --version, 1.12.1, --uuid, cac04f5f726f4192829024bdd9e7c9aa, --username, Koenn, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[16:56:43] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[16:56:43] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[16:56:43] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[16:56:43] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[16:56:43] [main/INFO]: Forge Mod Loader version 14.22.1.2479 for Minecraft 1.12.1 loading
[16:56:43] [main/INFO]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_101, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jdk1.8.0_101\jre
[16:56:43] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[16:56:43] [main/INFO]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin
[16:56:43] [main/INFO]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin
[16:56:43] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[16:56:43] [main/INFO]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[16:56:43] [main/INFO]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[16:56:43] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:56:43] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[16:56:43] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[16:56:43] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:56:43] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:56:43] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[16:56:46] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing
[16:56:46] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[16:56:46] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[16:56:47] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[16:56:47] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[16:56:47] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[16:56:47] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[16:56:49] [main/INFO]: Setting user: Koenn
[16:56:56] [main/INFO]: LWJGL Version: 2.9.4
[16:56:59] [main/INFO]: -- System Details --
Details:
	Minecraft Version: 1.12.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_101, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 2325250360 bytes (2217 MB) / 2560098304 bytes (2441 MB) up to 3817865216 bytes (3641 MB)
	JVM Flags: 2 total; -Xmx4g -Xms2g
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 385.41' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
[16:56:59] [main/INFO]: MinecraftForge v14.22.1.2479 Initialized
[16:56:59] [main/INFO]: Starts to replace vanilla recipe ingredients with ore ingredients.
[16:56:59] [main/INFO]: Replaced 1036 ore ingredients
[16:57:00] [main/INFO]: Found 0 mods from the command line. Injecting into mod discoverer
[16:57:00] [main/INFO]: Searching G:\Modding\Welcomer\run\mods for mods
[16:57:01] [main/INFO]: Forge Mod Loader has identified 5 mods to load
[16:57:01] [main/ERROR]: Could not dispatch event: public void net.minecraftforge.fml.common.LoadController.buildModList(net.minecraftforge.fml.common.event.FMLLoadEvent) to java.lang.RuntimeException: An unexpected exception occurred constructing the custom resource pack for Welcomer
[16:57:01] [main/ERROR]: Could not dispatch event: public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent) to java.lang.NullPointerException
[16:57:01] [main/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge
[16:57:01] [main/INFO]: Processing ObjectHolder annotations
[16:57:01] [main/INFO]: Found 1168 ObjectHolder annotations
[16:57:01] [main/INFO]: Identifying ItemStackHolder annotations
[16:57:01] [main/INFO]: Found 0 ItemStackHolder annotations
[16:57:01] [main/FATAL]: There is a severe problem with welcomer - it appears not to have constructed correctly
[16:57:01] [main/ERROR]: Could not dispatch event: public void net.minecraftforge.fml.common.LoadController.propogateStateMessage(net.minecraftforge.fml.common.event.FMLEvent) to java.lang.NullPointerException
[16:57:01] [main/INFO]: Applying holder lookups
[16:57:01] [main/INFO]: Holder lookups applied
[16:57:01] [main/INFO]: Applying holder lookups
[16:57:01] [main/INFO]: Holder lookups applied
[16:57:01] [main/INFO]: Applying holder lookups
[16:57:01] [main/INFO]: Holder lookups applied
[16:57:01] [main/INFO]: Applying holder lookups
[16:57:01] [main/INFO]: Holder lookups applied
[16:57:01] [main/INFO]: Injecting itemstacks
[16:57:01] [main/INFO]: Itemstack injection complete
[16:57:01] [main/FATAL]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue
[16:57:01] [main/FATAL]: 
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State | ID        | Version      | Source                           | Signature |
	|:----- |:--------- |:------------ |:-------------------------------- |:--------- |
	| U     | minecraft | 1.12.1       | minecraft.jar                    | None      |
	| U     | mcp       | 9.19         | minecraft.jar                    | None      |
	| U     | FML       | 8.0.99.99    | forgeSrc-1.12.1-14.22.1.2479.jar | None      |
	| U     | forge     | 14.22.1.2479 | forgeSrc-1.12.1-14.22.1.2479.jar | None      |
	| U     | welcomer  | 1.3          | Welcomer                         | None      |

[16:57:01] [main/FATAL]: The following problems were captured during this phase
[16:57:01] [main/ERROR]: Caught exception from welcomer (java.lang.RuntimeException)
[16:57:01] [Thread-3/INFO]: Using sync timing. 200 frames of Display.update took 110482154 nanos
[16:57:01] [main/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:630]: ---- Minecraft Crash Report ----
// I just don't know what went wrong :(

Time: 9/13/17 4:57 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from null (welcomer)
Caused by: java.lang.RuntimeException
	at net.minecraftforge.fml.common.LoadController.buildModObjectList(LoadController.java:289)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:225)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604)
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266)
	at net.minecraft.client.Minecraft.init(Minecraft.java:508)
	at net.minecraft.client.Minecraft.run(Minecraft.java:416)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.12.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_101, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 2012434184 bytes (1919 MB) / 2560098304 bytes (2441 MB) up to 3817865216 bytes (3641 MB)
	JVM Flags: 2 total; -Xmx4g -Xms2g
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.41 Powered by Forge 14.22.1.2479 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State | ID        | Version      | Source                           | Signature |
	|:----- |:--------- |:------------ |:-------------------------------- |:--------- |
	| U     | minecraft | 1.12.1       | minecraft.jar                    | None      |
	| U     | mcp       | 9.19         | minecraft.jar                    | None      |
	| U     | FML       | 8.0.99.99    | forgeSrc-1.12.1-14.22.1.2479.jar | None      |
	| U     | forge     | 14.22.1.2479 | forgeSrc-1.12.1-14.22.1.2479.jar | None      |
	| U     | welcomer  | 1.3          | Welcomer                         | None      |

	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 385.41' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
[16:57:01] [main/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:630]: #@!@# Game crashed! Crash report saved to: #@!@# G:\Modding\Welcomer\run\.\crash-reports\crash-2017-09-13_16.57.01-client.txt

And here's the github repo of the project.

 

Does anyone have a clue what's going on?

latest.log

crash-2017-09-13_16.57.01-client.txt

I'm a plugin developer, and I just started modding. Don't blame me for doing things wrong, Forge is not the same as Bukkit.

Posted

Yea, in your pack.mcmeta you have a comma after the pack_format which is causing the game to crash. Just remove it to fix the problem.

 

{
    "pack": {
        "description": "Welcomer resources",
        "pack_format": 3,
    }
}
  • Like 1
Posted
12 hours ago, MDW01 said:

Yea, in your pack.mcmeta you have a comma after the pack_format which is causing the game to crash. Just remove it to fix the problem.

 


{
    "pack": {
        "description": "Welcomer resources",
        "pack_format": 3,
    }
}

Oh, I completely didn't see that, thanks for pointing it out!

I'm a plugin developer, and I just started modding. Don't blame me for doing things wrong, Forge is not the same as Bukkit.

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I know that this may be a basic question, but I am very new to modding. I am trying to have it so that I can create modified Vanilla loot tables that use a custom enchantment as a condition (i.e. enchantment present = item). However, I am having trouble trying to implement this; the LootItemRandomChanceWithEnchantedBonusCondition constructor needs a Holder<Enchantment> and I am unable to use the getOrThrow() method on the custom enchantment declared in my mod's enchantments class. Here is what I have so far in the GLM:   protected void start(HolderLookup.Provider registries) { HolderLookup.RegistryLookup<Enchantment> registrylookup = registries.lookupOrThrow(Registries.ENCHANTMENT); LootItemRandomChanceWithEnchantedBonusCondition lootItemRandomChanceWithEnchantedBonusCondition = new LootItemRandomChanceWithEnchantedBonusCondition(0.0f, LevelBasedValue.perLevel(0.07f), registrylookup.getOrThrow(*enchantment here*)); this.add("nebu_from_deepslate", new AddItemModifier(new LootItemCondition[]{ LootItemBlockStatePropertyCondition.hasBlockStateProperties(Blocks.DEEPSLATE).build(), LootItemRandomChanceCondition.randomChance(0.25f).build(), lootItemRandomChanceWithEnchantedBonusCondition }, OrichalcumItems.NEBU.get())); }   Inserting Enchantments.[vanilla enchantment here] actually works but trying to declare an enchantment from my custom enchantments class as [mod enchantment class].[custom enchantment] does not work even though they are both a ResourceKey and are registered in Registries.ENCHANTMENT. Basically, how would I go about making it so that a custom enchantment declared as a ResourceKey<Enchantment> of value ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath([modid], [name])), declared in a seperate enchantments class, can be used in the LootItemRandomChanceWithEnchantedBonusCondition constructor as a Holder? I can't use getOrThrow() because there is no level or block entity/entity in the start() method and it is running as datagen. It's driving me nuts.
    • Hi here is an update. I was able to fix the code so my mod does not crash Minecraft. Please understand that I am new to modding but I honestly am having a hard time understanding how anyone can get this to work without having extensive programming and debugging experience as well as searching across the Internet, multiple gen AI bots (claude, grok, openai), and examining source code hidden in the gradle directory and in various github repositories. I guess I am wrong because clearly there are thousands of mods so maybe I am just a newbie. Ok, rant over, here is a step by step summary so others can save the 3 days it took me to figure this out.   1. First, I am using forge 54.1.0 and Minecraft 1.21.4 2. I am creating a mod to add a shotgun to Minecraft 3. After creating the mod and compiling it, I installed the .jar file to the proper directory in Minecraft and used 1.21.4-forge-54.1.0 4. The mod immediately crashed with the error: Caused by: java.lang.NullPointerException: Item id not set 5. Using the stack trace, I determined that the Exception was being thrown from the net.minecraft.world.item.Item.Properties class 6. It seems that there are no javadocs for this class, so I used IntelliJ which was able to provide a decompiled version of the class, which I then examined to see the source of the error. Side question: Are there javadocs? 7. This method, specifically, was the culprit: protected String effectiveDescriptionId() {      return this.descriptionId.get(Objects.requireNonNull(this.id, "Item id not set"));  } 8. Now my quest was to determine how to set this.id. Looking at the same source file, I determined there was another method:  public Item.Properties setId(ResourceKey<Item> pId) {             this.id = pId;             return this;   } 9. So now, I need to figure out how to call setId(). This required working backwards a bit. Starting from the constructor, I stubbed out the variable p which is of type Item.Properties public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); Rather than putting this all on one line, I split it up for readability like this: private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); Here is was the missing function, setId(), which takes a type of ResourceKey<Item>. My next problem is that due to the apparent lack of documentation (I tried searching the docs on this site) I could not determine the full import path to ResourceKey. I did some random searching on the Internet and stumbled across a Github repository which gave two clues: import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; Then I created the rk variable like this: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); And now putting it all together in order: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); This compiled and the mod no longer crashes. I still have more to do on it, but hopefully this will save someone hours. I welcome any feedback and if I missed some obvious modding resource or tutorial that has this information. If not, I might suggest we add it somewhere for people trying to write a mod that doesn't crash. Thank you !!!  
    • I will keep adding to this thread with more information in case anyone can help, or at the very least I can keep my troubleshooting organized. I decided to downgrade to 54.1.0 in the hopes that this would fix the issue but it didn't. At least now I am on a "recommended" version. The crash report did confirm my earlier post that the Exception is coming from effectiveDescriptionId(). I'll continue to see if I can find a way to set the ID manually.   Caused by: java.lang.NullPointerException: Item id not set         at java.base/java.util.Objects.requireNonNull(Objects.java:259) ~[?:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item$Properties.effectiveDescriptionId(Item.java:465) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item.<init>(Item.java:111) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ShotgunItem.<init>(ShotgunItem.java:19) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ModItems.lambda$static$0(ModItems.java:15) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister$EventDispatcher.lambda$handleEvent      
    • It just randomly stop working after a rebooted my dedicated server PLEASE HELP!   com.google.gson   Failed to start the minecraft server com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive; at path $  
  • Topics

×
×
  • Create New...

Important Information

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