Skip to content

Creating recipes for totems and bottles

Ruben Taelman edited this page Jul 15, 2024 · 6 revisions

In recent Minecraft version, it is possible to create custom recipes using JSON recipe files. These recipes can be added to your world by creating a custom data pack.

If you want to use totems or bottles from this mod as input and/or output in any of these recipes, that can be done by using the "components" entry within the recipe JSON files.

For example, the JSON recipe below adds a recipe that converts three white dye items into an ability totem containing the jump boost ability of level 5 and the speed ability of level 2:

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "DDD"
  ],
  "key": {
    "D": {
      "tag": "forge:dyes/white"
    }
  },
  "result": {
    "item": "everlastingabilities:ability_totem",
    "components": {
      "everlastingabilities:ability_store": {
        "everlastingabilities:effect/jump_boost": 5,
        "everlastingabilities:effect/speed": 2
      }
    }
  }
}

everlastingabilities:ability_totem can be replaced with everlastingabilities:ability_bottle to represent the contents of an ability bottle.

Defining data components in recipes

Since the abilities stored within totems and bottles are defined in the data components format, the "components" entry must be used within recipe JSON files to define the contents of totems and bottles.

The data component that must be defined is "everlastingabilities:ability_store", which can contain a map of ability names to their level. This means that a bottle or totem can contain zero or more abilities.

The general structure is the following:

{
      "components": {
      "everlastingabilities:ability_store": {}
    }
}

Each map entry represents one ability that is contained in the totem or bottle. For example, the following entry represents the jump boost ability of level 5:

"everlastingabilities:effect/jump_boost": 5

You can find a list of all available abilities here.

Clone this wiki locally