Jump to content

[1.13.2] com.google.gson.JsonSyntaxException: Expected item to be a JsonObject, was "str...ld"


PanSzelescik

Recommended Posts

[10mar2019 18:39:56.581] [Server thread/ERROR] [net.minecraftforge.common.crafting.CraftingHelper/CRAFTHELPER]: Parsing error loading constants strangetrees:recipes/_constants.json
com.google.gson.JsonSyntaxException: Expected item to be a JsonObject, was "str...ld"
    at net.minecraft.util.JsonUtils.getJsonObject(JsonUtils.java:247) ~[?:?]
    at net.minecraft.util.JsonUtils.getJsonObject(JsonUtils.java:253) ~[?:?]

What here is wrong?

_constants.json

Edited by PanSzelescik
Link to comment
Share on other sites

Check your file for weird characters and make sure you have the correct encoding

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Protip: All of your 'constants' are bad. The point of the constants json was to prevent massive duplication. If you're just redirecting to a single line for a tag. Then you're just wasting load time by making it a constant.

You should convert your 'emerald's to tags and skip _constants.json entirely.

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

Link to comment
Share on other sites

11 hours ago, LexManos said:

Protip: All of your 'constants' are bad. The point of the constants json was to prevent massive duplication. If you're just redirecting to a single line for a tag. Then you're just wasting load time by making it a constant.

You should convert your 'emerald's to tags and skip _constants.json entirely.

Okay I converted, but the same error is still there
 

Spoiler

[11mar2019 15:19:32.988] [Server thread/ERROR] [net.minecraftforge.common.crafting.CraftingHelper/CRAFTHELPER]: Parsing error loading constants strangetrees:recipes/_constants.json
com.google.gson.JsonSyntaxException: Expected item to be a JsonObject, was "str...ld"
    at net.minecraft.util.JsonUtils.getJsonObject(JsonUtils.java:247) ~[?:?]
    at net.minecraft.util.JsonUtils.getJsonObject(JsonUtils.java:253) ~[?:?]
    at net.minecraftforge.common.crafting.CraftingHelper.reloadConstants(CraftingHelper.java:339) [?:?]
    at net.minecraftforge.common.extensions.ForgeRecipeManager.onResourceManagerReload(ForgeRecipeManager.java:48) [?:?]
    at net.minecraft.item.crafting.RecipeManager.onResourceManagerReload(RecipeManager.java:39) [?:?]
    at net.minecraft.resources.SimpleReloadableResourceManager.triggerReloadListeners(SimpleReloadableResourceManager.java:125) [?:?]
    at net.minecraft.resources.SimpleReloadableResourceManager.reload(SimpleReloadableResourceManager.java:101) [?:?]
    at net.minecraft.server.MinecraftServer.loadDataPacks(MinecraftServer.java:1518) [?:?]
    at net.minecraft.server.MinecraftServer.loadDataPacks(MinecraftServer.java:400) [?:?]
    at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:76) [?:?]
    at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:99) [?:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:595) [?:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]

Updated _constants.json

Link to comment
Share on other sites

Again your issue is that you're being stupid and using a constant when a standard item/tag would do:

    {
        "name": "strangetrees:super_infusion_emerald",
        "item": "strangetrees:super_infusion_emerald"
    },
                    else if (json.has("item"))
                        tmp.put(name, new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));

Follow the correct spec for _constants if you're gunna use them.

 

Basically, _constants was created as a precursor to tags. 

If you're just using ONE item use the item directly.

If you have basic list items that have no meta/nbt. Then use a tag.

ONLY use _constants if you're using custom ingredients/nbt.

 

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

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • हथियार व्यापारियों की चमक आज के समय में भारत और दुनिया के विभिन्न हिस्सों में तेजी से बढ़ रही है। स्वीडन की स्थित संस्था सिपरी की नवीनतम रिपोर्ट के अनुसार, विश्व भर में विभिन्न देश अब पूर्व कभी नहीं देखे गए हथियारों और सैन्य सामग्रियों पर धन का व्यय कर रहे हैं। वैश्विक संघर्षों के बढ़ते संकेतों के कारण, विश्व के कई हिस्सों में युद्ध की संभावनाएं बढ़ रही हैं। पश्चिमी एशिया में युद्ध की आग फैल रही है, जबकि दक्षिण चीन सागर और ताइवान में भी तनाव बढ़ रहा है। भारत-चीन सीमा पर भी स्थिति चिंताजनक है। इन घटनाओं के परिणामस्वरूप, विभिन्न देशों की प्राथमिकताएं बदल रही हैं, और हथियार व्यापारियों का धंधा आजकल चमक उठा है। सिपरी की रिपोर्ट के अनुसार, 2023 में वैश्विक सैन्य खर्च एक नया रिकॉर्ड स्थापित किया गया है। 2022 की तुलना में, 2023 में सैन्य खर्च 6.8 फीसदी बढ़कर 24.4 ट्रिलियन डॉलर पर पहुंच गया। इसके पीछे कुछ विशेष कारण हैं, जिनमें दुनिया भर में तनाव बढ़ना और अद्यतित सैन्य तैयारियों की आवश्यकता शामिल है। इस वृद्धि में, भारत जैसे देशों का योगदान भी अधिक है। भारत ने भी अपने सैन्य खर्चों में वृद्धि की है, और यह दुनिया के सबसे बड़े और सबसे प्रभावशाली राष्ट्रों में एक बन गया है। इसके अलावा, अमेरिका, चीन, और रूस भी सैन्य खर्च में वृद्धि की हैं, जिससे विश्व सुरक्षा में नए दायरे खुले हैं। संभावनाओं के इस नए मंच पर, दुनिया के सक्षम देश अब अपने सैन्य तैयारियों में ज्यादा ध्यान दे रहे हैं। यह वृद्धि विकास और प्रगति के बजट पर भी प्रभाव डाल रही है, जिससे विभिन्न देशों के आर्थिक प्रगति में बदलाव आ सकता है।   https://www.nayaindia.com/editorial-column/editorial1/arms-sales-increased-in-the-world-454072.html
    • Hello, Hi and I am making a forge 1.12.2 mod and also trying to get a custom model helmet item (I made a joker mask) and exported it to .json format and put it in the ~/namespace/models/item folder. Though, I'm struggling to get the item to render what I want it to be rendered like as I've positioned it in the 'head' window view in blockbench. How did you render out your model? I checked your code and it looks like no references to the actual model are being made. I'm new to this forge modding stuff (was a fabric modder) and I desperately need some help. Is there a way to standardly render out armor models made using blockbench? any methods that one can use? My model in JSON: ```json { "credit": "Made with Blockbench", "texture_size": [160, 160], "textures": { "0": "ydyrn:items/joker_mask_texture", "particle": "ydyrn:items/joker_mask_texture" }, "elements": [ { "from": [0, 0, 0], "to": [16, 16, 1], "faces": { "north": {"uv": [0, 1.7, 16, 14.2], "texture": "#0"}, "east": {"uv": [0, 4, 0.9, 5.6], "texture": "#0"}, "south": {"uv": [0, 5.8, 1.6, 7.4], "texture": "#0"}, "west": {"uv": [0, 1.9, 1.3, 3.5], "texture": "#0"}, "up": {"uv": [0, 3.4, 1.6, 4.2], "texture": "#0"}, "down": {"uv": [0, 9, 1.6, 9.7], "texture": "#0"} } }, { "from": [15.8, 11, 0.5], "to": [16.2, 13, 15], "faces": { "north": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "east": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "south": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "west": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "up": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"}, "down": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"} } }, { "from": [0.2, 11, 14.6], "to": [15.8, 13, 15], "faces": { "north": {"uv": [7.9, 7.9, 9.46, 8.1], "texture": "#0"}, "east": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "south": {"uv": [7.9, 7.9, 9.46, 8.1], "texture": "#0"}, "west": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "up": {"uv": [7.9, 7.9, 9.46, 7.94], "texture": "#0"}, "down": {"uv": [7.9, 7.9, 9.46, 7.94], "texture": "#0"} } }, { "from": [-0.2, 11, 0.5], "to": [0.2, 13, 15], "faces": { "north": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "east": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "south": {"uv": [7.9, 7.9, 7.94, 8.1], "texture": "#0"}, "west": {"uv": [7.9, 7.9, 9.35, 8.1], "texture": "#0"}, "up": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"}, "down": {"uv": [7.9, 7.9, 7.94, 9.35], "texture": "#0"} } } ], "display": { "thirdperson_righthand": { "translation": [-0.25, -2.75, 0], "scale": [0.3, 0.3, 0.3] }, "thirdperson_lefthand": { "translation": [-0.25, -2.75, 0], "scale": [0.3, 0.3, 0.3] }, "firstperson_righthand": { "rotation": [-9, 115, 15], "translation": [0, 1.25, -1.75], "scale": [0.5, 0.5, 0.5] }, "firstperson_lefthand": { "rotation": [-9, 115, 15], "translation": [0, 1.25, -1.75], "scale": [0.5, 0.5, 0.5] }, "ground": { "rotation": [40, 0, 0], "translation": [0, -2.5, 0], "scale": [0.5, 0.5, 0.5] }, "gui": { "rotation": [0, 180, 0] }, "head": { "translation": [0, 0, 0.25], "scale": [0.82773, 0.73594, 0.9] }, "fixed": { "translation": [0, 0, 8.75] } }, "groups": [ 0, { "name": "straps", "origin": [0, 0, 0], "color": 0, "children": [1, 2, 3] } ] } ```
    • Add the crash-report or latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • In your config folder, delete the sophisticatedcore-common.toml file and test it again
  • Topics

×
×
  • Create New...

Important Information

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