Jump to content

i tried to bought 2 potions of invisibility on the computer and now i can't open my world


Recommended Posts

Posted

---- Minecraft Crash Report ----
// Don't do that.

Time: 1/3/23 9:39 PM
Description: Unexpected error

java.lang.NoSuchMethodError: net.minecraft.item.ItemStack.getItemDamage()I
    at com.teamderpy.shouldersurfing.client.ShoulderHelper.isHoldingSpecialItem(ShoulderHelper.java:108)
    at com.teamderpy.shouldersurfing.config.CrosshairType.isDynamic(CrosshairType.java:20)
    at com.teamderpy.shouldersurfing.client.ShoulderRenderer.offsetCrosshair(ShoulderRenderer.java:52)
    at com.teamderpy.shouldersurfing.event.ClientEventHandler.preRenderGameOverlayEvent(ClientEventHandler.java:55)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_123_ClientEventHandler_preRenderGameOverlayEvent_Pre.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
    at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:895)
    at net.minecraftforge.client.GuiIngameForge.renderCrosshairs(GuiIngameForge.java:217)
    at net.minecraftforge.client.GuiIngameForge.func_73830_a(GuiIngameForge.java:130)
    at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1038)
    at JinRyuu.JBRA.JBRAEnRen.func_78480_b(JBRAEnRen.java:61)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    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:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


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

-- Head --
Stacktrace:
    at com.teamderpy.shouldersurfing.client.ShoulderHelper.isHoldingSpecialItem(ShoulderHelper.java:108)
    at com.teamderpy.shouldersurfing.config.CrosshairType.isDynamic(CrosshairType.java:20)
    at com.teamderpy.shouldersurfing.client.ShoulderRenderer.offsetCrosshair(ShoulderRenderer.java:52)
    at com.teamderpy.shouldersurfing.event.ClientEventHandler.preRenderGameOverlayEvent(ClientEventHandler.java:55)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_123_ClientEventHandler_preRenderGameOverlayEvent_Pre.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
    at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:895)
    at net.minecraftforge.client.GuiIngameForge.renderCrosshairs(GuiIngameForge.java:217)
    at net.minecraftforge.client.GuiIngameForge.func_73830_a(GuiIngameForge.java:130)
    at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1038)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['SacredCandle288'/247, l='MpServer', x=-32.26, y=54.62, z=-396.85]]
    Chunk stats: MultiplayerChunkCache: 285, 285
    Level seed: 0
    Level generator: ID 00 - default, ver 1. Features enabled: false
    Level generator options: 
    Level spawn location: World: (-233,64,-178), Chunk: (at 7,4,14 in -15,-12; contains blocks -240,0,-192 to -225,255,-177), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
    Level time: 3836722 game time, 5553211 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
    Forced entities: 64 total; [EntityWolf['Wolf'/256, l='MpServer', x=-19.44, y=66.00, z=-390.13], EntitySquid['Squid'/257, l='MpServer', x=-8.91, y=56.09, z=-371.50], EntitySquid['Squid'/258, l='MpServer', x=-12.50, y=56.38, z=-374.34], EntitySquid['Squid'/259, l='MpServer', x=-6.50, y=56.34, z=-371.50], EntityZombie['Zombie'/260, l='MpServer', x=-50.50, y=13.00, z=-387.50], EntitySkeleton['Skeleton'/261, l='MpServer', x=-24.38, y=15.00, z=-422.22], EntitySquid['Squid'/262, l='MpServer', x=-21.16, y=57.31, z=-363.50], EntityItem['item.tile.cactus'/263, l='MpServer', x=-48.53, y=64.13, z=-403.88], EntitySabertooth['Sabertooth'/264, l='MpServer', x=8.78, y=69.00, z=-430.13], EntitySabertooth['Sabertooth'/265, l='MpServer', x=13.84, y=68.00, z=-426.19], EntityZombie['Zombie'/266, l='MpServer', x=17.91, y=11.00, z=-394.47], EntityZombie['Zombie'/267, l='MpServer', x=-19.50, y=25.00, z=-342.50], EntitySheep['Sheep'/268, l='MpServer', x=-1.50, y=67.00, z=-337.66], EntityTigerBandit['Tiger Bandit'/269, l='MpServer', x=17.28, y=67.00, z=-428.66], EntityBat['Bat'/270, l='MpServer', x=-86.28, y=17.09, z=-394.25], EntitySheep['Sheep'/271, l='MpServer', x=-25.38, y=63.00, z=-334.53], EntitySheep['Sheep'/272, l='MpServer', x=-27.91, y=70.00, z=-326.84], EntityCreeper['Creeper'/273, l='MpServer', x=-89.84, y=18.00, z=-409.66], EntityZombie['Zombie'/274, l='MpServer', x=-86.50, y=18.00, z=-406.50], EntityZombie['Zombie'/275, l='MpServer', x=-85.03, y=16.00, z=-402.50], EntitySkeleton['Skeleton'/276, l='MpServer', x=20.50, y=27.00, z=-339.50], EntitySkeleton['Skeleton'/277, l='MpServer', x=20.06, y=26.00, z=-336.47], EntitySheep['Sheep'/278, l='MpServer', x=22.50, y=70.00, z=-344.50], EntitySheep['Sheep'/279, l='MpServer', x=23.38, y=72.00, z=-344.53], EntitySheep['Sheep'/280, l='MpServer', x=17.13, y=68.00, z=-348.06], EntitySheep['Sheep'/281, l='MpServer', x=-58.50, y=72.00, z=-452.50], EntitySkeleton['Skeleton'/282, l='MpServer', x=43.50, y=40.00, z=-359.50], EntitySheep['Sheep'/283, l='MpServer', x=37.47, y=64.00, z=-359.69], EntityZombie['Zombie'/285, l='MpServer', x=-105.34, y=55.00, z=-407.84], EntityZombie['Zombie'/286, l='MpServer', x=-104.31, y=56.00, z=-406.44], EntityTFNagaSegment['unknown'/545, l='MpServer', x=0.00, y=0.00, z=0.00], EntityCreeper['Creeper'/289, l='MpServer', x=-105.00, y=26.00, z=-419.50], EntityTFNagaSegment['unknown'/546, l='MpServer', x=0.00, y=0.00, z=0.00], EntityTFNagaSegment['unknown'/547, l='MpServer', x=0.00, y=0.00, z=0.00], EntityCreeper['Creeper'/291, l='MpServer', x=-82.06, y=37.00, z=-454.63], EntityTFNagaSegment['unknown'/548, l='MpServer', x=0.00, y=0.00, z=0.00], EntityZombie['Zombie'/292, l='MpServer', x=-98.41, y=36.00, z=-435.88], EntityTFNagaSegment['unknown'/549, l='MpServer', x=0.00, y=0.00, z=0.00], EntityTFNagaSegment['unknown'/550, l='MpServer', x=0.00, y=0.00, z=0.00], EntitySpider['Spider'/294, l='MpServer', x=21.50, y=30.00, z=-469.63], EntityTFNagaSegment['unknown'/551, l='MpServer', x=0.00, y=0.00, z=0.00], EntityZombie['Zombie'/295, l='MpServer', x=24.50, y=39.00, z=-464.50], EntityTFNagaSegment['unknown'/552, l='MpServer', x=0.00, y=0.00, z=0.00], EntityTFNagaSegment['unknown'/553, l='MpServer', x=0.00, y=0.00, z=0.00], EntityTFNagaSegment['unknown'/554, l='MpServer', x=0.00, y=0.00, z=0.00], EntityTFNagaSegment['unknown'/555, l='MpServer', x=0.00, y=0.00, z=0.00], EntityTFNagaSegment['unknown'/556, l='MpServer', x=0.00, y=0.00, z=0.00], EntitySheep['Sheep'/182, l='MpServer', x=-104.28, y=63.00, z=-345.47], EntitySheep['Sheep'/183, l='MpServer', x=-104.50, y=70.00, z=-340.66], EntitySheep['Sheep'/184, l='MpServer', x=-97.03, y=64.00, z=-346.03], EntitySheep['Sheep'/189, l='MpServer', x=-87.84, y=64.00, z=-349.13], EntitySheep['Sheep'/190, l='MpServer', x=-89.81, y=72.00, z=-326.63], EntitySheep['Sheep'/191, l='MpServer', x=-89.34, y=69.00, z=-335.56], EntitySheep['Sheep'/213, l='MpServer', x=-63.31, y=72.00, z=-320.13], EntityTigerBandit['Tiger Bandit'/228, l='MpServer', x=-38.22, y=70.00, z=-330.80], EntityTigerBandit['Tiger Bandit'/229, l='MpServer', x=-44.30, y=70.00, z=-324.77], EntityTigerBandit['Tiger Bandit'/230, l='MpServer', x=-38.28, y=70.00, z=-324.90], EntityZombie['Zombie'/248, l='MpServer', x=-47.94, y=13.00, z=-387.50], EntityItem['item.item.itemrecipebook'/249, l='MpServer', x=-35.09, y=53.13, z=-395.13], EntityItem['item.tile.cactus'/250, l='MpServer', x=-47.81, y=64.13, z=-398.84], EntityClientPlayerMP['SacredCandle288'/247, l='MpServer', x=-32.26, y=54.62, z=-396.85], EntityEnderman['Enderman'/253, l='MpServer', x=-31.50, y=55.00, z=-395.50], EntityWolf['Wolf'/254, l='MpServer', x=-20.66, y=65.00, z=-387.84], EntityWolf['Wolf'/255, l='MpServer', x=-21.31, y=66.00, z=-390.72]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373)
    at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2444)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:927)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    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:497)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 555633904 bytes (529 MB) / 1924661248 bytes (1835 MB) up to 3817865216 bytes (3641 MB)
    JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4096m -Xms256m
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 38 mods loaded, 38 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UCHIJAAAA    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
    UCHIJAAAA    FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAA    Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar) 
    UCHIJAAAA    CodeChickenCore{1.0.7.48} [CodeChicken Core] (minecraft.jar) 
    UCHIJAAAA    NotEnoughItems{1.0.5.120} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.5.120-universal.jar) 
    UCHIJAAAA    AppleCore{3.1.1} [AppleCore] (AppleCore-mc1.7.10-3.1.1.jar) 
    UCHIJAAAA    BiomesOPlenty{2.1.0} [Biomes O' Plenty] (BiomesOPlenty-1.7.10-2.1.0.2308-universal.jar) 
    UCHIJAAAA    bookshelf{1.0.4.187} [Bookshelf] (Bookshelf-1.7.10-1.0.4.187.jar) 
    UCHIJAAAA    chocolateQuest{1.0} [Chocolate Quest] (chocolateQuest-1.7.10-1.0.jar) 
    UCHIJAAAA    controlling{1.7.10-1.0.0.4} [Controlling] (Controlling-1.7.10-1.0.0.4.jar) 
    UCHIJAAAA    jinryuujrmcore{1.3.46} [JinRyuu's JRMCore] (JRMCore-v1.3.46.jar) 
    UCHIJAAAA    jinryuudragonblockc{1.4.83} [Dragon Block C] (DragonBlockC-v1.4.83.jar) 
    UCHIJAAAA    DynamicLights{1.3.9a} [Dynamic Lights] (Dynamic-Lights-Mod-1.7.10.jar) 
    UCHIJAAAA    dsurround{1.0.6.4} [Dynamic Surroundings] (DynamicSurroundings-1.7.10-1.0.6.4.jar) 
    UCHIJAAAA    thebombzenapi{2.4.1} [ThebombzenAPI] (Thebombzen-API-1.7.10.jar) 
    UCHIJAAAA    enchantview{4.0.4} [EnchantView] (EnchantView-Mod-1.7.10.jar) 
    UCHIJAAAA    fastleafdecay{1.4} [Fast Leaf Decay] (FastLeafDecay-1.7.10-1.4.jar) 
    UCHIJAAAA    gravestone{0.7.10.3} [Gravestone] (GraveStone+Mod+0.7.10.3.jar) 
    UCHIJAAAA    iChunUtil{4.2.3} [iChunUtil] (iChunUtil-4.2.3.jar) 
    UCHIJAAAA    IronChest{6.0.62.742} [Iron Chest] (ironchest-1.7.10-6.0.62.742-universal.jar) 
    UCHIJAAAA    ironfurnaces{1.2.4} [Iron Furnaces] (ironfurnaces-1.2.4R.jar) 
    UCHIJAAAA    jinryuubetterrenderaddon{1.6.51} [JinRyuu's Better Render Addon] (JBRA-Client-v1.6.51.jar) 
    UCHIJAAAA    jdam{1.7.0} [Jwan's DBC Essentials] (JDE-1.7.0.jar) 
    UCHIJAAAA    jinryuufamilyc{1.2.18} [JinRyuu's Family C] (JFamilyC-v1.2.18.jar) 
    UCHIJAAAA    jinryuuhdskinsextended{1.3.1} [JinRyuu's HD Skins Extended] (JinRyuu's-HDSkins-Mod-1.7.10-v1.3.1.jar) 
    UCHIJAAAA    journeymap{5.1.4p2} [JourneyMap] (journeymap-1.7.10-5.1.4p2-unlimited.jar) 
    UCHIJAAAA    jinryuuyearsc{1.2.5} [JinRyuu's Years C] (JYearsC-v1.2.5.jar) 
    UCHIJAAAA    LovelyRobot{1.2.1} [LovelyRobot] (LovelyRobot-Mod-1.7.10.jar) 
    UCHIJAAAA    RadixCore{2.1.3} [RadixCore] (RadixCore-1.7.10-2.1.3-universal.jar) 
    UCHIJAAAA    MCA{1.7.10-5.2.2} [Minecraft Comes Alive] (MCA-1.7.10-5.2.2-universal.jar) 
    UCHIJAAAA    mending{1.0} [Mending for 1.7.10] (Mending+for+1.7.10-1.1.jar) 
    UCHIJAAAA    MouseTweaks{2.4.4} [Mouse Tweaks] (MouseTweaks-2.4.4-mc1.7.10.jar) 
    UCHIJAAAA    cfm{3.4.7} [§9MrCrayfish's Furniture Mod] (MrCrayfishFurnitureModv3.4.7(1.7.10).jar) 
    UCHIJAAAA    naturescompass{1.3.1} [Nature's Compass] (NaturesCompass-1.7.10-1.3.1.jar) 
    UCHIJAAAA    shouldersurfing{2.2.17} [Shoulder Surfing] (ShoulderSurfing-1.7.10-2.2.17.jar) 
    UCHIJAAAA    testdummy{1.0} [MmmMmmMmmMmm] (Test-Dummy-Mod-1.7.10.jar) 
    UCHIJAAAA    TwilightForest{2.3.8dev} [The Twilight Forest] (twilightforest-1.7.10-2.3.8.jar) 
    UCHIJAAAA    waystones{1.0.12} [Waystones] (Waystones-mc1.7.10-1.0.12.jar) 
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 516.94' Renderer: 'NVIDIA GeForce GTX 1650/PCIe/SSE2'
    Launched Version: forge-10.13.4.1614
    LWJGL: 2.9.1
    OpenGL: NVIDIA GeForce GTX 1650/PCIe/SSE2 GL version 4.6.0 NVIDIA 516.94, NVIDIA Corporation
    GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs: [Authentic Shadows_1.7.zip, PureBDcraft 128x MC17.zip, Sphax_MinecraftComesAlive_128x.zip, Sphax_IronFurnaces_1.12(128x).zip, Sphax_IronChests_128x.zip, Sphax128x_TwilightForest_Ver2.0.3.zip, Sphax128x_FurnitureMod_V3.4.7.zip, Sphax128x_BOP_Ver2.1.0.1396.zip, Kasai Blocks v0.1.0.zip, Kasai_DBC_v6.58.1.zip, Kasai Dragon Block Heroes v0.2.6.zip]
    Current Language: English (US)
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Anisotropic Filtering: Off (1)

Posted

The version you are using is no longer supported on this forum.

Please update to a modern version of Minecraft to receive support.

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

Guest
This topic is now closed to further replies.

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.