Skip to content

JsonThings Integration

Sara Freimer edited this page Jun 23, 2024 · 2 revisions

JsonThings Integration

As of MC 1.20.1, Mekanism has built-in support for JsonThings allowing users to create custom chemicals using ThingPacks.

Chemical Definitions

There are four types of Chemicals in Mekanism: gases, infuse types, pigments, and slurries. This wiki page will go into how to define "Things" for each of these types. Each chemical goes into the corresponding directory (mekanism/gas, mekanism/infuse_type, mekanism/pigment, mekanism/slurry) in the thing pack. For example:

/things/examplepack/mekanism/gas/custom_gas.json
/things/examplepack/mekanism/infuse_type/custom_infuse_type.json
/things/examplepack/mekanism/pigment/custom_pigment.json
/things/examplepack/mekanism/slurry/custom_slurry.json

Basic common structure of the JSON file

{
  "texture": "mekanism:pigment/base",
  "tint": "#6532A8",
  "color_representation": 3319890,
  "attributes": {
    "radioactivity": 1.0
  }
}

"texture"

Defines the texture the chemical should use when rendered in GUIs or tubes.

Optional. Default: a base texture for each chemical type that then will have a tint applied to it.

Must be a resource location string like "base", or "mekanism:infuse_type/base". Like on tag jsons and other vanilla files, if the namespace (the part before the colon) is missing "minecraft" is implied.

"tint"

Defines a color tint that will be multiplied with the texture colors. Alpha is ignored and unneeded.

Optional. Default: white (no tint).

Can be:

  1. A number between 0 and 2^24-1.
  2. A string containing a hex color code, such as "#AABBCC". Short form colors ("#ABC") are NOT supported.
  3. A json array containing elements for [r, g, b].
  4. A json object containing values for "r", "g", "b".

Eg:

{ "r": 255, "g": 0, "b": 255 }

"color_representation"

Defines a color that will be used in "durability" bars of things like chemical tanks when displaying storage information. Alpha is ignored and unneeded.

Optional. Default: Uses the tint of the chemical.

Can be:

  1. A number between 0 and 2^24-1.
  2. A string containing a hex color code, such as "#AABBCC". Short form colors ("#ABC") are NOT supported.
  3. A json array containing elements for [r, g, b].
  4. A json object containing values for "r", "g", "b".

Eg:

{ "r": 255, "g": 0, "b": 255 }

"hidden"

Note: This option has been removed in 1.21+ Please use the c:hidden_from_recipe_viewers tag instead.

Defines if the chemical should be hidden from JEI and filled tanks in creative.

Optional. Default: false (not hidden).

Must be a boolean (true or false). Values of false are treated as if the property was not specified.

"attributes"

Defines any chemical attributes the chemical has.

Optional. Default: no attributes.

Must be a json object.

Gas Specific Attributes

"radioactivity"

Specifies the radioactivity of the gas. Radioactivity is a positive double measured in Sv/h.

"coolant"

Specifies that this coolant is either a heated coolant or a cooled coolant. If it is a heated coolant then the json object should contain a "cooled_gas" key, if this is a cooled coolant it a "heated_gas" should be used instead.

"coolant": {
  "heated_gas": "chemical_test:heated_test",
  "thermal_enthalpy": 5.0,
  "conductivity": 1.0
}

"cooled_gas" and "heated_gas" must be a resource location string like "other_state", or "example:other_state". Like on tag jsons and other vanilla files, if the namespace (the part before the colon) is missing "minecraft" is implied. This resource location must correspond to another gas.

Thermal enthalpy is a number greater than zero that defines how much energy one mB of the chemical can store; lower values will cause reactors to require more of the chemical to stay cool.

Conductivity is a number that must be greater than zero and be at most one. It defines the proportion of a reactor's available heat that can be used at an instant to convert this coolant's cool variant to its heated variant.

"fuel"

Specifies stats for using the gas as a fuel in the Gas-Burning Generator.

This is of the form:

"fuel": {
  "burn_ticks": 5,
  "energy_density": "10.3"
}

Burn ticks is the number of ticks one mB of fuel can be burned for before being depleted; must be greater than zero.

Energy Density is a Floating Long that must be greater than zero and can be represented by a string or a positive number

Slurry Specific

Slurries have a few properties that are specific to them and not shared with other chemicals.

"clean"

Defines if the slurry should use the default "clean" texture or the "dirty" texture.

Required if "texture" is not provided, otherwise will error if both "texture" and "clean" are provided.

Must be a boolean (true or false).

"ore"

Defines the tag the slurry should treat as an "ore" for purposes of displaying in the Chemical Crystallizer.

Optional.

Must be a resource location string like "gold_ores", or "forge:ores/gold". Like on tag jsons and other vanilla files, if the namespace (the part before the colon) is missing "minecraft" is implied.

Clone this wiki locally