Jump to content

Recommended Posts

Posted

Im trying to patch into nugget.json to allow malachite and native copper to be powdered in the pulverizer, and ive tried about 100 different things but none of them work. The game either crashes upon loading into the test world or crashes and spits out the same error: 

Running on 64 bit Windows 10.0.26200.0 with 16107 MB RAM
Game Version: v1.21.5 (Stable)
11/15/2025 11:13:36 AM: Critical error occurred
Loaded Mods: kaolinitemod@1.0.0, game@1.21.5, creative@1.21.5, survival@1.21.5
System.NullReferenceException: Object reference not set to an instance of an object.
   at Vintagestory.API.Common.CollectibleObject.GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo) in VintagestoryApi\Common\Collectible\Collectible.cs:line 1769
   at Vintagestory.API.Common.Item.GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo) in VintagestoryApi\Common\Collectible\Item\Item.cs:line 173
   at Vintagestory.GameContent.ItemOre.GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, Boolean withDebugInfo) in VSSurvivalMod\Item\ItemOre.cs:line 71
   at Vintagestory.API.Common.ItemStack.GetDescription(IWorldAccessor world, ItemSlot inSlot, Boolean debug) in VintagestoryApi\Common\Collectible\ItemStack.cs:line 402
   at Vintagestory.GameContent.GuiHandbookItemStackPage..ctor(ICoreClientAPI capi, ItemStack stack) in VSSurvivalMod\Systems\Handbook\Gui\GuiHandbookItemStackPage.cs:line 42
   at Vintagestory.GameContent.ModSystemSurvivalHandbook.onCreatePagesAsync() in VSSurvivalMod\Systems\Handbook\SurvivalHandbook.cs:line 115
   at Vintagestory.GameContent.GuiDialogHandbook.LoadPages_Async() in VSSurvivalMod\Systems\Handbook\Gui\GuiDialogHandbook.cs:line 417
   at Vintagestory.API.Common.TyronThreadPool.<>c__DisplayClass13_0.<QueueTask>b__0(Object a) in VintagestoryApi\Common\TyronThreadPool.cs:line 131
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

I got this patch to work and allow for claystone to be grinded into powder in the quern: 

[
  {
    "op": "addmerge",
    "path": "/grindingPropsByType/stone-claystone",
    "value": {
      "groundStack": { "type": "item", "code": "kaoliniteyay:crushedclaystone", "stacksize": 1 }
    },
    "file": "game:itemtypes/resource/stone.json"
  }
]

but for the life of me I CANNOT figure out how to make this patch work:

[
  {
    "op": "addmerge",
    "path": "/crushingPropsByType",
    "file": "game:itemtypes/resource/nugget.json",
    "value": {
      "nugget-nativecopper": {
        "crushedStack": { "type": "item", "code": "kaoliniteyay:copperpowder" },
        "quantity": { "avg": 1.5 },
        "hardnessTier": 2
      },
      "nugget-malachite": {
        "crushedStack": { "type": "item", "code": "kaoliniteyay:copperpowder" },
        "quantity": { "avg": 1.5 },
        "hardnessTier": 2
      }
    }
  }
]

I've tried so many different things. Not even straight up copy pasting the base game crushing properties for lead nuggets and then changing the items it refers to so that it matched the copper powder worked. If anyone needs me to give anything else to figure out, please ask. I'm nearing my limit with this bs.

Posted

Looking at the provided stacktrace, it's failing while appending the crushing props info to the tooltip:
image.thumb.png.8f5a6e3522fc5eba1e1c3741408f9ab3.png

Tested the patch with "game:stick" instead of "kaoliniteyay:copperpowder" (because I don't have the mod this item is from) and it worked just fine, meaning it most likely failed to find your item. So would recommend double checking the code and that it is indeed an Item and not a Block.

Posted
4 hours ago, The Insanity God said:

Looking at the provided stacktrace, it's failing while appending the crushing props info to the tooltip:
image.thumb.png.8f5a6e3522fc5eba1e1c3741408f9ab3.png

Tested the patch with "game:stick" instead of "kaoliniteyay:copperpowder" (because I don't have the mod this item is from) and it worked just fine, meaning it most likely failed to find your item. So would recommend double checking the code and that it is indeed an Item and not a Block.

worked perfectly. I hadn't defined the class of copper powder and it was going crazy on me because of it. Thank you so much, I cant believe I missed such a small thing

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.