This page is about the JSON the rendering for a tool. For the behavior of a tool, see Tool Definitions.

This page describes the format for tool models, which assign the materials to part textures in the tool.

Tool

Tool models are used to list parts for a tool and how they match up to each material on the tool. In addition, they define the location to search for textures for modifier models, which are used to render recipe modifiers on the tool. Finally, this model supports making the tool appear extra large in hand by defining an additional set of 32x textures.

Tool models have the following format:

  • (Object): Connected Model JSON.
    • loader (Resource Location): Always tconstruct:tool.
    • textures (Object): Mapping of texture name to texture value in the tool.
      • <name> (Resource Location): Texture for the part <name> on small 16x tools.
      • large_<name> (Resource Location): Texture for the 32x part <name> on large tools. Unused if large is false.
    • parts (Array): List of textures to render in the tool. If unset, defaults to a single non-material part named tool. Until 1.18.2, the default part set broken to broken.
      • (Object): A single part object. Parts will layer in the order in the parts list.
        • name (String): Part name. Corresponds to a texture in textures.
        • index (Integer): Material index on the tool for the part. If unset, part will not have material variants.
        • broken (String, until 1.18.2): If set, uses this name from textures when the tool is broken instead of name. 1.19+ uses Overrides to handle broken tools instead.
    • large (Boolean): If true, tool will render in hand using a 32x texture with the same pixel density as small tools. Causes parts to use the large_ prefix on their name.
    • large_offset (Array): If set, the model will be offset by the set number of pixels in large tools. Allows holding the tool notably higher or lower without complex math computing displays.
      • (Integer): First value in the list is the X offset, where negative is left and positive is right.
      • (Integer): Second value in the list is the Y offset, where negative is up and positive is down.
    • modifier_roots (Array): If large is false, used to specify a list of texture prefixes to search for modifier textures. Will try each prefix in order until a texture is found for the modifier.
    • modifier_roots (Object): If large is true, used to specify a list of texture prefixes for both the large and small tool variants to search for modifier textures. Will try each prefix in order until a texture is found for the modifier.
    • first_modifiers (Array): List of modifiers to render on the tool before any other modifiers are rendered. Any modifiers not in this list are rendered in priority order. Order determines the order these modifiers render on the tool.
      • (Modifier ID): Modifier name to render before other modifiers when present.
      • (Object): First modifier object, allowing forcing a modifier to render even if not present.
        • name (Modifier ID): Modifier name to render before other modifiers.
        • forced (Boolean): If true, the modifier will always render even if not present on the tool’s recipe modifiers; useful for tank display. If false (default), the modifier will only render if present in the tool’s modifier list. Useful for forcing a tool trait to render.

Overrides

Tool models make use of a bunch of custom item overrides to define behaviors such as brokeness, blocking, and charging up the tool. These overrides are added in the same format as vanilla item models.

The following overrides are added to all tools and armor:

  • tconstruct:broken: Since 1.19, this property is set to 1 when the tool is broken, and 0 otherwise. Used to change tool textures when broken in a far more stable way than the vanilla durability property.

The following overrides are added to all held tools, though not to bows and crossbows on 1.18:

  • tconstruct:charging: If 1, the tool is currently being charged, e.g. a bow is being drawn back or a modifier is charging up before use. If 2, the tool is currently blocking like a shield.
  • tconstruct:charge: Value between 0 and 1 indicating how much the tool is charged. If tconstruct:charging is 2, the tool is both blocking and being charged up; used by some modifier combinations.

The following properties are added to crossbows:

  • tconstruct:ammo: Set to 2 when the crossbow is loaded with fireworks. Set to 1 when the crossbow is loaded with an arrow.

In 1.18.2, the following properties are added to bows and crossbows instead of tconstruct:charging and tconstruct:charge:

  • tconstruct:pulling: Same behavior as tconstruct:charging on bows.
  • tconstruct:pull: Same behavior as tconstruct:charge on bows.