Tool Definitions 1.16-1.18
This page is about the JSON defining a tool properties from 1.16 to 1.18.2. For the format since 1.19, see Tool Definitions. For the recipes defining tool crafting, see Tool Recipes.
Tool definitions are a JSON format defined by Tinkers’ Construct to assign behaviors to tools. This page covers the format of tool definitions between 1.16 and 1.18.
Tool definitions are located under data/<domain>/tinkering/tool_definitions/<name>.json for the tool definition ID <domain>:<name>.
Format
A tool definition has the following format:
- The root tool definition object.
- List of tool parts for each material index. Order determines the order of materials in all relevant contexts. If unset, tool will have no parts (which is either required or disallowed based on the tool’s stat provider).
- A part requirement.
- Tool part item for the index, must implement
IToolPartand have a valid stat type for the tool’s stat provider. May not be set alongsidestat. - Stat type for the index, must be valid for the tool’s stat provider. May not be set alongside
part. - Weight of the part, used when there are multiple parts of the same type for a weighted average. If unset, defaults to 1.
- Tool part item for the index, must implement
- A part requirement.
- Sets the base stats and multipliers for the tool. If unset, tool uses default values for all base stats and 1.0 multipliers.
- Mapping from tool stat IDs to the value to set for that stat. If unset, tool uses default values for all base stats.
- Sets the value for
<tool_stat>to the given value. JSON type is determined by the stat.
- Sets the value for
- Mapping from numeric tool stat IDs to the multiplier value.
- Sets the multiplier for
<tool_stat>to the given value.
- Sets the multiplier for
- Mapping from tool stat IDs to the value to set for that stat. If unset, tool uses default values for all base stats.
- Starting modifier slots for this tool. If unset, the tool has no starting slots.
- Number of slots added of the slot type
<slot>.
- Number of slots added of the slot type
- List of starting tool traits. If unset, defaults to an empty list.
- A tool trait.
- Modifier to apply as a trait.
- Level of the modifier to apply. If unset, defaults to 1.
- A tool trait.
- Since 1.18, set of tool actions which may be performed by this tool. If unset, defaults to an empty list.
- A tool action which may be performed by this tool.
- Since 1.18, sets various properties related to using the tool has a harvest tool. If unset, the tool uses default harvest logic and no AOE iterator.
- Determines the effective blocks for the tool along with additional mining speed bonuses. If unset, uses default harvest logic.
- The harvest logic type.
- Any other fields defined by the harvest logic type.
- Determines the shape of AOE mining on the tool. If unset, the tool has no AOE mining.
- The AOE iterator type.
- Any other fields defined by the AOE iterator type.
- Determines the effective blocks for the tool along with additional mining speed bonuses. If unset, uses default harvest logic.
- Since 1.18, determines the shape of AOE mining on the tool. If unset, the tool has no AOE mining.
- The weapon attack type.
- Any other fields defined by the weapon attack type.
- Since 1.18.2, map of additional tool hook ID to a tool module implementing that hook. If unset, tool implements no additional hooks.
- Module implementing the tool hook
<tool_hook>.- The tool module type.
- Any other fields defined by the tool module type.
- Module implementing the tool hook
- List of tool parts for each material index. Order determines the order of materials in all relevant contexts. If unset, tool will have no parts (which is either required or disallowed based on the tool’s stat provider).
Stat Providers
All tools must have a stat provider, which determines which tool parts are allowed and required, and how those parts are used to compute stats. Stat providers are defined in Java, meaning they cannot be configured for a given tool. The following stat providers are valid for tools requesting a stat provider:
tconstruct:no_parts: Stat provider for a tool with no tool parts. Will cause the tool definition to error if the parts array has any values.tconstruct:melee_harvest: Stat provider for melee weapons and harvest tools. Requires one or more parts of stat typetconstruct:head, and also supports stat typestconstruct:handleandtconstruct:extra. See Melee/Harvest Stat Type for more info.tconstruct:ranged: Since 1.18.2, stat provider for ranged weapons such as bows. Requires one or more parts of stat typetconstruct:limb, and also supports stat typestconstruct:gripandtconstruct:bowstring. See Ranged Stat Type for more info.
In addition, the following stat providers are used but not registered (meaning they are not available to JSON Things):
- Skull Stats: Stat provider for slime skulls. Requires one or more parts of stat type
tconstruct:skull. See Skull Stat Type for more info.
Harvest Logic
Harvest logic determines which blocks a tool is effective on, additional modifiers to tool mining speed, and the maximum tier a tool may harvest. Tool harvest logic has the following format:
- A harvest logic object.
- The harvest logic type.
- Any other fields defined by the harvest logic type.
The following subsections describe the formats for specific harvest logic types.
Effective Tag
Tag harvest logic defines the most common form of harvest logic using a tag to describe effective blocks. It has the following format:
- A harvest logic object.
- Always
tconstruct:effective_tag. - Block tag containing the blocks this tool is effective on.
- Always
Modified Tag
The modified tag harvest logic defines harvest logic that is effective on a given tag, but also has additional mining speed modifiers to specific blocks. It is notably used by the mattock to allow mining some blocks that are not marked as effective a bit faster. It has the following format:
- A harvest logic object.
- Always
tconstruct:modified_tag. - Block tag containing the blocks this tool is effective on.
- List of mining speed modifiers to apply.
- Multiplier to mining speed for any blocks matching the block predicate.
- Block predicate determining the blocks affected by this modifier. Uses the legacy Tinkers’ Construct block predicate.
- Always
Fixed Tier
The fixed tier harvest logic defines harvest logic that is effective on a given tag, but cannot mine above the listed mining tier. It is notably used by the pickadze to limit the mining tier to gold. It has the following format:
- A harvest logic object.
- Always
tconstruct:fixed_tier. - Block tag containing the blocks this tool is effective on.
- Maximum mining tier for this tool.
- Always
AOE Iterators
AOE iterators implement different shapes of multi-block harvest on tools, including with how they expand when the expander modifier is applied. They have the following base format:
- A AOE iterator object.
- The AOE iterator type.
- Any other fields defined by the AOE iterator type.
The following subsections describe the formats for specific AOE iterator types.
Box AOE Iterator
The box AOE iterator defines tool AOE in a cube, with the following format:
- A tool module object.
- Always
tconstruct:box. - Box size expansion applied when the tool has no expanders.
- Base box width radius, defaults to 0.
- Base box height radius, defaults to 0.
- Base box depth, defaults to 0.
- List of expansions to apply at each level. If the level exceeds the list size, will cycle through the list again. For example, if the list size is 2 and the level is 3, the first expansion is applied twice and the second once.
- Box size expansion for a level.
- Level box width radius, defaults to 0.
- Level box height radius, defaults to 0.
- Level box depth, defaults to 0.
- Box size expansion for a level.
- Determines how
width,height, anddepthare oriented with respect to the player’s position and targeted block. By default, the following options exist:tconstruct:side_hit: Orients based on the targeted block face.widthis to the left/right of the target,heightis above/below the target, anddepthback behind the target.tconstruct:pitch: Orients based on the direction the player is facing.widthis to the left/right of the player view,heightis above/below the player view, anddepthback behind the player view.tconstruct:height: Orients height to the Y axis,widthto the left/right of the side hit, anddepthbehind the target. When targeting the top or bottom of a block,widthorients to the left/right of the player view, anddepthbehind the player view.
- Always
Circle AOE Iterator
The circle AOE iterator defines tool AOE in a radius around the targeted block, with the following format:
- A tool module object.
- Always
tconstruct:circle. - Base diameter, summed with the expander value for the total size.
- If true, AOE area will be a 3D half sphere. If false (default), will be a circle.
- Always
Tree AOE Iterator
The tree AOE iterator defines tool AOE that targets all matching logs in a tree. It has the following format:
- A tool module object.
- Always
tconstruct:tree. - Bonus width radius applied at level 0, defaults to 0. Every other level starting with the first increases width by 1.
- Bonus depth applied at level 0, defaults to 0. Every other level starting with the second increases depth by 1.
- Always
Veining AOE Iterator
The veining AOE iterator defines tool AOE that targets all matching connected blocks up to a given recursion depth.
- A tool module object.
- Always
tconstruct:vein. - Maximum distance from the targeted block through matching blocks to include, defaults to 0. Summed with the expander level.
- Always
Fallback AOE Iterator
The fallback AOE iterator nests two AOE iterators, using the first if the targeted block matches the given predicate, or the fallback if it does not match the predicate. It has the following format:
- A tool module object.
- Always
tconstruct:fallback. - Block tag to check.
- Iterator to run if
tagmatches the targeted block. - Iterator to run if
tagdoes not match the targeted block.
- Always
Weapon Attacks
Weapon attacks implement additional behavior that runs after attacking with the tool. They have the following base format:
- A weapon attack object.
- The weapon attack type.
- Any other fields defined by the weapon attack type.
The following subsections describe the formats for specific weapon attack types.
Particle Weapon Attack
The particle weapon attack module defines a particle to display whenever attacking with this weapon while fully charged. It has the following format:
- A tool module object.
- Always
tconstruct:particle. - Particle to display on fully charged attacks. Must be a
SimpleParticleType.
- Always
Circle Weapon Attack
The circle weapon attack defines an AOE attack centered on the target when the weapon is fully charged. All targets will be targeted by a full attack, meaning modifiers will apply to each target separately but more durability is consumed.
The circle weapon attack has the following format:
- A tool module object.
- Always
tconstruct:circle. - Range from the original target to also hit with the attack, defaults to 0. The expander level will add to this range.
- Always
Sweep Weapon Attack
The sweep weapon attack grants a tool a sweeping attack, similar to the vanilla sword’s sweep attack. The attack AOE is centered on the attacker, and all targets are dealt damage based damage dealt to the main target scaled by the level of sweeping edge. Modifiers are not applied to additional target, and conditional damage such a smite only considers the primary target.
The sweep weapon attack has the following format:
- A tool module object.
- Always
tconstruct:sweep. - Range from the attacker to perform the sweep attack, defaults to 0. The expander level will be added to this range.
- Always
Tool Hooks
Tool hooks are used to define additional behaviors on a tool beyond those covered in the default serializer. The following tool hooks exist:
tconstruct:tool_interaction: Hook defining whether a given interaction modifier is allowed to run on the tool. Used to control whether interaction modifiers run on “attack” or “interact” for tools that support multiple methods of interaction, or to ensure only blocking runs on “interact” on shields.
The reason there is only a single tool hook is because the system was implemented to allow flexability in addons, with the intention of eventually migrating tool type specific behaviors such as attack or harvest to tool hooks. This migration was ultimately completed in 1.19.
Tool Modules
Tool modules are used to implement tool hooks. Unlike the system that would eventually come to 1.19, tool modules in 1.18 may only implement a single hook. They have the following base format:
- A tool module object.
- The tool module type.
- Any other fields defined by the tool module type.
The following subsections describe the format for specific tool modules.
Dual Interaction
The dual interaction module implements the tconstruct:tool_interaction hook for a tool that can interact on both “attack” (left click) and “interact” (right click). By default, all interaction modifiers will run on “interact” with this hook, but any modifiers defined in the tool’s persistent data set tconstruct:attack_modifiers will trigger on attack instead. Modifiers are added to that set using the modifier set recipe.
The dual interaction module has a type of tconstruct:dual_option_interaction, and no additional fields.
Preference Set Interaction
The preference set interaction module implements the tconstruct:interaction hook for a tool that can interact on both “attack” (left click) and “interact” (right click). This module defines a set of modifiers which interact on one source, and all modifiers outside that set interact on the other source. It is notably used on shields, which set “interact” to the blocking modifier, and run all other interaction modifiers on left click.
The preference set interaction module has the following format:
- A tool module object.
- Always
tconstruct:preference_set_interaction. - Predicate matching modifiers to put on
preferred_source. Any modifiers that don’t match the predicate will interact on the other source. - Interaction source to use for
preferred_modifiers. May beright_click(for interact) orleft_click(for attack).
- Always