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.

Featured Replies

Posted

I'm trying to add some recipes using a basic item I made, but I keep getting the same error for every recipe. All my items show up fine in-game, but the recipes just don't work. I have my recipes saved in Tutorialmod/src/main/resources/data/tutorialmod/recipes/tutorial_block.json. Please help, I can't find any solutions for this that work.

Here's how I made my recipe:
{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        "III",
        "III",
        "III"
    ],
    "key": {
        "I": {"item": "tutorialmod:tutorial_item"},
    },
    "result": {"item": "tutorialmod: tutorial_block"} 
}

 

Here's the error I kept getting:
[24Jan2020 20:54:55.938] [Server-Worker-7/ERROR] [net.minecraft.client.resources.JsonReloadListener/]: Couldn't parse data file tutorialmod:tutorial_block from tutorialmod:recipes/tutorial_block.json
com.google.gson.JsonParseException: com.google.gson.stream.MalformedJsonException: Expected name at line 10 column 3 path $.key.I
    at net.minecraft.util.JSONUtils.fromJson(JSONUtils.java:359) ~[?:?]
    at net.minecraft.util.JSONUtils.fromJson(JSONUtils.java:398) ~[?:?]
    at net.minecraft.client.resources.JsonReloadListener.prepare(JsonReloadListener.java:51) ~[?:?]
    at net.minecraft.client.resources.JsonReloadListener.prepare(JsonReloadListener.java:22) ~[?:?]
    at net.minecraft.client.resources.ReloadListener.lambda$reload$0(ReloadListener.java:12) ~[?:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604) [?:1.8.0_241]
    at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1596) [?:1.8.0_241]
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_241]
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_241]
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_241]
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_241]
Caused by: com.google.gson.stream.MalformedJsonException: Expected name at line 10 column 3 path $.key.I
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1559) ~[gson-2.8.0.jar:?]
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:505) ~[gson-2.8.0.jar:?]
    at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:414) ~[gson-2.8.0.jar:?]
    at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:738) ~[gson-2.8.0.jar:?]
    at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:739) ~[gson-2.8.0.jar:?]
    at com.google.gson.internal.bind.TypeAdapters$29.read(TypeAdapters.java:714) ~[gson-2.8.0.jar:?]
    at com.google.gson.internal.bind.TypeAdapters$35$1.read(TypeAdapters.java:910) ~[gson-2.8.0.jar:?]
    at net.minecraft.util.JSONUtils.fromJson(JSONUtils.java:357) ~[?:?]
    ... 10 more

Your json is invalid.

https://jsonlint.com/

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

As an aside, you can add a json editor to Eclipse so it catches these kinds of errors for you.

 

  • Author

Thanks for the help. Also, how would I add a json editor to eclipse and what’s a good one to use?

1 hour ago, Turtle_Bot said:

Thanks for the help. Also, how would I add a json editor to eclipse and what’s a good one to use?

Search the marketplace for "json" there's about three. I use the one called "json editor plugin"

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.