Skip to content

Assigning a formula to an item or a tag

Cat Core edited this page Nov 29, 2020 · 5 revisions

Item formula are assigned using datapacks.

They can be assigned per item or per tag.

The file content must look like this:

{
  // Formula compounds
  "molecules": [
    {
      "amount": 144, // the amount of the compound in the formula
      "formula": "h2o" // the formula of a molecule (must be lowercase)
    },
    {
      "amount": 81,
      "formula": "Fe" // or the symbol of an atom (case sensitive)
    }
  ],
  "replace": false // Should this file overwrite or not others with the same name.
}

The folder where you place this file depends on what you want it to be applied to:

I want to apply it to an item:

The path and the name of the file depends on the item identifier. e.g. "minecraft:iron_ingot" for Iron Ingot.

You will need the namespace "minecraft" and the path "iron_ingot".

The file path should look like this: <namespace>/molecules/item/<path>.json.

I want to apply it to a tag:

The path and the name of the file depends on the tag identifier. e.g. "minecraft:logs" for Wood Logs.

You will need the namespace "minecraft" and the path "logs".

The file path should look like this: <namespace>/molecules/tag/<path>.json.

Clone this wiki locally