Jump to content

Recommended Posts

Posted

When I Run the client, and put the items in the correct order in the crafting table, nothing comes out at all! Here is my json file:

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    " A ",
    "ASA",
    " A "
  ],
  "key": {
    "S": {
      "item": "minecraft:bone"
    },
    "A": [
      {
        "item": "minecraft:cooked_beef"
      },
    ]
  },
  "result": {
    "item": "im:pet_treat"
  }
}

im:pet_treat is an item id in the game. I tested this with other items and blocks and even changed the result but it still didn't work. Can anyone help?

Posted

Your recipe json has syntax errors. Specifically these lines:

7 minutes ago, cherrylime said:

"A":
[
    {
        "item": "minecraft:cooked_beef"
    },
]

As an advice - install any kind of json syntax plugin in your IDE. It will then tell you if your json has syntax errors.

Alternatively you can check your json files through a json validator like jsonlint.

  • Like 1
Posted

Here is my new code. It still does not work. Do I have to do anything to register the crafting recipe?

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    " A ",
    "ASA",
    " A "
  ],
  "key": {
    "S": {
      "item": "minecraft:bone"
    },
    "A": [
      {
        "item": "minecraft:cooked_beef"
      },
    ]
  },
  "result": {
    "item": "im:pet_treat",
    "data": 0
  }
}

Posted

I changed the code to this to make the JSON valid, but it still is not working in the game.

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    " A ",
    "ASA",
    " A "
  ],
  "key": {
    "S": {
      "item": "minecraft:bone"
    },
    "A": {
        "item": "minecraft:cooked_beef"
   },
  "result": {
    "item": "im:pet_treat",
    "data": 0
  }
  }
}

Posted

By changing the structure of your json. Currently your result property is one of the properties specified in the key object. It however must be on the same level as the type property(have no parent). Pull it up one level. See this page on the minecraft wiki for the json structure.

Posted

I have changed my code to this:

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    " A ",
    "ASA",
    " A "
  ],
  "key": {
    "S": {
      "item": "minecraft:bone"
    },
    "A": {
        "item": "minecraft:cooked_beef"
   }
    }
       "result": {
    "item": "im:pet_treat",
    "data": 0
  }
}

 

However no result shows up. Do I need to register this crafting recipe on a different class or interface?

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



×
×
  • Create New...

Important Information

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