Skip to content

Custom Crock Pot Cooking Recipe

SihenZhang edited this page Dec 3, 2021 · 1 revision

In 1.16.5-2.0.0 or higher version, Crock Pot Cooking Recipe uses IRecipe from vanilla Minecraft. So if you want to custom Crock Pot Cooking Recipe, you need to create a datapack first.

Add Crock Pot Cooking Recipe

First, you need to create folder recipes in your datapack. And then you can create JSON files to define Crock Pot Cooking Recipes. The syntax format is as follows.

  • type: Used to describe the type of recipe. In this case it can only be "crockpot:crock_pot_cooking".

  • requirements: A JSON array used to describe the requirements of the recipe. It contains JSON objects used to describe the specific requirement.

  • result: A string value or JSON object to describe the output item. If it is a JSON object, the structure is like below:

    • item: The namespace id of the item.
    • count: The count of the item.
  • priority: An integer value used to describe the priority of the recipe. If the input matches two different recipes, the recipe with the higher priority will eventually be matched.

  • weight: An optional integer value used to describe the weight of the recipe. The value should be greater than 0. If the input matches two different recipes with the same priority, it will match a random one based on the weight. The higher the weight of the recipe, the higher the probability that the recipe will be randomly matched. It will fall back to 1 if the field is absent.

  • cookingtime: An integer value used to describe the cooking time (tick) of the recipe.

  • potlevel: An integer value used to describe the level of Crock Pot required for the recipe. 0 is the Basic Crock Pot, 1 is the Advanced Crock Pot and 2 is the Ultimate Crock Pot.

There are 8 types of requirements for the recipe.

  • category_max: The maximum value of the corresponding food category of the input. (input <= max )
  • category_max_exclusive: The maximum value of the corresponding food category of the input (not including this value itself). (input < max )
  • category_min: The minimum value of the corresponding food category of the input. (input >= min )
  • category_min_exclusive: The minimum value of the corresponding food category of the input (not including this value itself). (input > min )

The types above have a similar syntax format.

  • type: A string value used to describe the type of the requirement.
  • category: A string value used to describe the food category. It should be MEAT, MONSTER, FISH, EGG, FRUIT, VEGGIE, DAIRY, SWEETENER, FROZEN and INEDIBLE.
  • max: A float value used to describe the maximum value of the corresponding food category of the input. It's required if the type is category_max or category_max_exclusive.
  • min: A float value used to describe the minimum value of the corresponding food category of the input. It's required if the type is category_min or category_min_exclusive.
  • must_contain_ingredient: The input contains at least a certain number of specific ingredients.
  • must_contain_ingredient_less_than: The input contains at most a certain number of specific ingredients.

The types above have a similar syntax format.

  • type: A string value used to describe the type of the requirement.
  • ingredient: A JSON object or JSON array used to describe the ingredient. The syntax format of ingredient can be found in Recipe/Ingredient – Official Minecraft Wiki (fandom.com).
  • quantity: An integer value used to describe the count of the ingredient.
  • combination_and: A combination requirement that requires both requirements to be met.
  • combination_or: A combination requirement that requires any one of the requirements to be met.

The types above have a similar syntax format.

  • type: A string value used to describe the type of the requirement.
  • first: A JSON object used to describe the first requirement.
  • second: A JSON object used to describe the second requirement.

Here is an example in Crock Pot mod. This recipe requires 2 Raw Chicken, and meat values should be greater than 1.0, veggie values or fruit values should be greater than 0.0.

{
  "type": "crockpot:crock_pot_cooking",
  "requirements": [
    {
      "type": "must_contain_ingredient",
      "ingredient": [
        {
          "tag": "forge:raw_chicken"
        },
        {
          "tag": "forge:rawmeats/rawchicken"
        },
        {
          "tag": "forge:rawchicken/rawchicken"
        },
        {
          "tag": "forge:rawchicken"
        },
        {
          "item": "autumnity:turkey_piece"
        }
      ],
      "quantity": 2
    },
    {
      "type": "category_min_exclusive",
      "category": "MEAT",
      "min": 1.5
    },
    {
      "type": "combination_or",
      "first": {
        "type": "category_min_exclusive",
        "category": "VEGGIE",
        "min": 0.0
      },
      "second": {
        "type": "category_min_exclusive",
        "category": "FRUIT",
        "min": 0.0
      }
    }
  ],
  "result": "crockpot:turkey_dinner",
  "priority": 10,
  "cookingtime": 800,
  "potlevel": 0
}

Override Food Values for Item

If you want to override the Crock Pot Cooking Recipe in the mod, just create your datapack with the namespace crockpot and override the specified JSON file. If the JSON file is empty, it will delete the specific recipe.