Better Json files for Recipes

Started by MrBelles on Thu, 12/31/2020 - 04:03

Topic category: Feature requests and ideas for MCreator

Last seen on 02:13, 6. Mar 2021
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Better Json files for Recipes
Thu, 12/31/2020 - 04:03

I noticed recently that the way my recipe .json files are saved is ineffeicent. For example if I made a reciepe for a custom armor peice the file would be written as this:

{
  "group": "mymod",
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "0  2",
    "345",
    "678"
  ],
  "key": {
    "0": {
      "item": "mymod:amethyst"
    },
    "2": {
      "item": "mymod:amethyst"
    },
    "3": {
      "item": "mymod:amethyst"
    },
    "4": {
      "item": "mymod:amethyst"
    },
    "5": {
      "item": "mymod:amethyst"
    },
    "6": {
      "item": "mymod:amethyst"
    },
    "7": {
      "item": "mymod:amethyst"
    },
    "8": {
      "item": "mymod:amethyst"
    }
  },
  "result": {
    "item": "mymod:amethyst_armor_chestplate",
    "count": 1
  }
}

This could be simplified to be smaller if I edit the code to be this:

{
  "group": "mymod",
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "0  0",
    "000",
    "000"
  ],
  "key": {
    "0": {
      "item": "mymod:amethyst"
    }
  },
  "result": {
    "item": "mymod:amethyst_armor_chestplate",
    "count": 1
  }
}

Can you improve recipe creation to make smaller files so I don't have to do it myself and lock the code?