Recently, I’ve been seeing multiple threads of people who want to start modding, which is great! It’s always a good thing for more people to get involved with modding. But, as was inevitable, many of these aspiring modders get errors when trying to create their mod, most of which, their solutions are easy. However, new modders might not know all the steps to take when checking for coding issues.
So I’ve decided to make a quick little list of steps to take when your mod throws an error, and you don’t know what caused it.
-
Always, always, copy and paste your code in http://jsonlint.com/. This website will check and see if you’re missing anything basic, like a missing semi-colon (;), comma (,), or squiggle bracket ({ or })
-
The log is your friend. Located at C:\Program Files (x86)\Steam\steamapps\common\Stonehearth, any error that pops up in game will appear here, along with some others. If something’s not working, check here. It’ll tell you what file is having a problem.
-
A specific error that might appear when launching the game, or appear in the Log, is one that might look like this:
This occurs because somewhere in your mod, you’ve typed a line of code that is trying to reference the alias in your mod’s manifest. This is typically attributed to a crafter with a recipe that’s trying to make that item.
The Solution? Check for misspelling’s in your manifest and recipe file.
Sample messed up alias
"decoration:rune_ston_small" : "file(entities/decoration/rune_stone_small/rune_stone_small.json)",
[details=Line in recipe that refers to missing alias.] "produces": [
{
"item": "runes:decoration:rune_stone_small"
}
]
[/details]
In this example, the line in the recipe is looking for an alias called “decoration:rune_stone_small”, when the alias in the manifest is “decoration:rune_ston_small”.
This error can also happen when the file path to the Json is messed up. Make sure the file path in the Manifest is the same as the File Path in your file browser.
Sample messed up alias
"decoration:rune_stone_small" : "file(entities/decoration/rune_stone_small.json)",
Sample Correct alias
"decoration:rune_stone_small" : "file(entities/decoration/rune_stone_small/rune_stone_small.json)",
4. If you’re making a mod with an en.json (Stores all the Strings[words, tooltips, names, etc]), and the item in question displays the file path of the string, and not the string itself, something is spelled wrong. Double check all of your spellings, and make sure you aren’t missing anything.
Example wrong
"recipe_name": "i18n(runes:jobs.mason.rune_stone_small_recipe.recipe_name)",
Example right
"recipe_name": "i18n(runes:jobs.mason.recipes.rune_stone_small_recipe.recipe_name)",
The issues was the missing “recipes” inside the path.
If you think I should add in any steps (I’m gonna need too), or if they didn’t solve it for you, reply here and I’ll help you out.
Example code was taken from @8BitCrab’s Rune mod, for which I am an official updater for.