Foodstuff

Estimated reading time: 2 minutes

Foodstuff registration adds new ingredients, dishes, drinks, or growable items to vanilla setup.foodstuff.

Entry Point

maplebirch.tool.patch.addFoodstuff(key, config);

key is the unique foodstuff id. Use a mod prefix to avoid collisions.

Minimal Example

maplebirch.tool.patch.addFoodstuff("my_mod_berry", {
  name: "strange berry",
  singular: "strange berry",
  plural: "strange berries",
  category: "fruit",
  icon: "my-mod-berry.png",
  shop: {
    sell_price: 80,
  },
});

Common Fields

FieldDescriptionDefault
indexVanilla foodstuff indexAuto
nameDisplay nameDerived from key
singularSingular namename
pluralPlural namename + "s"
iconIcon filename${key}.png
categoryCategory such as fruit, ingredient, or dishingredient
kitchen_item_type_iconKitchen category iconrecipe-ingredient.png
prop_folderProp image folderingredient
shop.sell_priceSell price0
shop.available_inShops where it can appear, such as ["supermarket"]-
recipeRecipe config-
food.tagsFood tags such as vegan, drink, or sweet-
tendingGrowable item config-

Dish Example

maplebirch.tool.patch.addFoodstuff("my_mod_soup", {
  name: "herbal soup",
  singular: "serving of herbal soup",
  plural: "servings of herbal soup",
  category: "dish",
  kitchen_item_type_icon: "recipe-food.png",
  prop_folder: "food",
  shop: {
    sell_price: 500,
  },
  recipe: {
    recipe_name: "herbal soup",
    difficulty: 1,
    cook_minutes: 20,
    servings: 1,
    ingredients: ["wild_carrot", "salt"],
    tags: [],
  },
  food: {
    tags: ["vegan"],
  },
});

boot.json

Object-map form. This is the recommended format when registering multiple entries.

{
  "framework": {
    "foodstuff": {
      "my_mod_berry": {
        "name": "strange berry",
        "category": "fruit",
        "shop": {
          "sell_price": 80
        }
      },
      "my_mod_soup": {
        "name": "herbal soup",
        "category": "dish",
        "kitchen_item_type_icon": "recipe-food.png",
        "prop_folder": "food",
        "shop": {
          "sell_price": 500
        },
        "recipe": {
          "recipe_name": "herbal soup",
          "difficulty": 1,
          "cook_minutes": 20,
          "servings": 1,
          "ingredients": ["wild_carrot", "salt"],
          "tags": []
        }
      }
    }
  }
}

External .json, .yaml, or .yml file:

{
  "framework": {
    "foodstuff": "data/foodstuff.yaml"
  }
}

Array form is also supported. Each item must include key:

- key: my_mod_berry
  name: strange berry
  category: fruit
  shop:
    sell_price: 80
- key: my_mod_soup
  name: herbal soup
  category: dish
  kitchen_item_type_icon: recipe-food.png
  prop_folder: food
  shop:
    sell_price: 500
  recipe:
    recipe_name: herbal soup
    difficulty: 1
    cook_minutes: 20
    servings: 1
    ingredients:
      - wild_carrot
      - salt
    tags: []