This page is about using texture generators for data pack or resource pack authors. For addon authors, see the texture generator documentation.

Tinkers’ Construct 3 makes extensive use of data generators to generate material variants of tool parts with more detail than a simple tint. The generate part textures command makes this feature available to data pack and resource pack creators.

The generator command is primarily meant for use by mod pack, data pack and resource pack authors, along with creators of low code mods (this command for instance was used in the creation of Tinkers’ Things). Java addon creators will have a much better experience using the texture generator during datagen.

Command Usage

The command is run as follows:

Syntax:

/tconstruct generate_part_textures <filter> [mod_id|material]

Arguments:

  • <filter> (String): Filter operation. May be one of the following:
    • all: Generates all textures. Useful when entirely replacing a material or tool in a resource pack.
    • missing: Generates all textures that currently lack a texture. Useful when generating textures for new tools or materials.
  • [mod_id] (String): Filters the materials to only those provided by the passed mod.
  • [material] (Material ID): Filter to only the selected material.

The command may run slowly due to the large number of textures required to generate. It will automatically generate a resource pack containing textures for all registered parts in all registered materials. For players, you can simply use this resource pack right after generating, though it may be desirable to create a zip file resource pack if you plan to distribute it as part of a mod or resource pack.

By default, the command runs using settings generated by Tinkers’ Construct and addons. There are two parts to these settings: material render info, and generator part textures, which can both be configured using resource packs (as described in the following sections)

Part Textures

The part texture JSON controls the list of tool parts. For each tool part, a copy of that part will be generated for each applicable material.

The part texture JSON is located at assets/<domain>/tinkering/generator_part_textures.json, or at assets/<domain>/models/tconstruct_generator_part_textures.json in 1.16. It will be merged across all mods, meaning you can expect any addons adding tools to define a copy of this file under their own domain. It has the following format:

  • (Object): Root generator part texture object.
    • replace (Boolean):
      • If true, will ignore copies of this file for this domain in lower resource packs. Note if you intend to disable all textures set by mods, you will need to set this to true for each mod ID providing a copy of the file.
      • If false (default), will merge with lower packs under the same mod ID until a repalce is encountered.
    • parts (Array): List of part textures to generate.
      • (Object): A part object.
        • path (Resource Location): Path to the texture.
        • stat_type (Stat Type): Stat type for the texture. If the material render info does not support this stat type, this pairing will be skipped. In 1.16-1.18.2, this field is instead named statType.
        • stat_type (Array, since 1.19.2): List of stat types for this texture. The texture will be generated if any of them is supported.
          • stat_type (Stat Type): Stat type in the list.
        • baseFolder (Boolean, 1.16 only):: This field determines whether textures automatically prepend item/tool. As of 1.18, this field is removed and all textures are relative to the base textures folder.
          • If true, textures are relative to assets/<mod_id>/textures/.
          • If false, textures are relative to assets/<mod_id>/textures/item/tool/ (default).
    • overrides (Object): Since 1.18.2, defines a list of stat type overrides to apply. Used to add an additional stat type to a material without modifying its render type info (for instance, when said material is from another mod). If unset, no overrides are applied.
      • <stat_type> (Array): Material stat type to override.
        • (Material Variant): Material variant to add to the stat type <stat_type> for the generator.

For a given part with path <mod_id>:<part_name>, the base texture will be located at assets/<mod_id>/textures/<part_name>.png, or assets/<mod_id>/textures/item/tool/<part_name>.png in 1.16 if baseFolder is false or unset.

Variants of the texture will be located under assets/<mod_id>/textures/<part_name>_<variant>.png or assets/<mod_id>/textures/item/tool/<part_name>_<variant>.png, where <variant> is one of the following:

  • For a fallback <fallback>, the variant is <fallback>.
  • For a material ID <domain>:<name>, the variant is <domain>_<name>.
  • For a material variant ID <domain>:<name>#<variant>, the variant is <domain>_<name>_<variant>.

Materials

The list of materials used for the generator will be filtered from all material render info with a generator object defined, which defines how the generator command will run for the given material, see that page for the full JSON format.

Within the material render info, the texture determines the output location of the generated material part texture. The fallbacks array is used to select a texture to pass into the generator; if no fallback exists the base texture is passed to the generator. color and luminosity are ignored by the generator.

A material is considered valid for a part if any of the following hold true:

  • The part stat type is in the material’s supportedStats list.
  • ignoreMaterialStats is false and the material has stats for the part’s stat type defined in it’s material stats.
  • In 1.18.2+, an override is defined in the part textures JSON listing the material variant under the stat type.