Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted
[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

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)

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

  • Author
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

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.