Skip to content

Tinkers' JSON Things Plugin

KnightMiner edited this page Jan 13, 2023 · 7 revisions

Tinkers' Construct adds support for the mod Json Things, enabling you to create new tools and tool parts without writing any code. This page describes all the supported item types. See the Json Things documentation for more info on how to add things.

Items

Tinkers' Construct adds in several new item types described in the sections below. Items are placed under things/<pack id>/items/, with the type key set to the ID described below.

While usage of default keys varies, it is always recommended to set group to set item creative tabs.

Casts

Casts items are not special, so the standard plain type will work for creating casts. Casts do not have a special model, but do have a few notable tags and recipes.

The base mod has 3 types of casts: gold casts (reusable), sand casts (single use), and red sand casts (single use, alternate texture). When creating cast items, if you add them to the appropriate tags, they will automatically get applicable recycling recipes, while single use/multi use is defined by the JSON recipes.

Sand casts are typically created using a molding table recipe, while gold casts are created with a casting table recipe. Note that there is no difference between recipes for tool parts or non-tool parts for cast creation.

Material items

Tinkers' Construct has two types of material items, tconstruct:tool_part, and tconstruct:repair_kit.

Material items typically use the following recipes:

  • Part Builder Recipe: Handles creating the part using the part builder for any allowed materials.
  • Sand Cast and Gold Cast casting: handles creating the part by pouring fluid in a cast for any allowed materials.
  • Composite Casting: handles creating the part by casting fluid on another part for any allowed materials.

And the following assets:

  • Pattern texture: Used for the part builder icon and the slot background in the Tinker Station
  • Model: Using the tconstruct:material loader will color the part based on the material
  • Generator Part Textures: Will allow you to generate material textures using the command

Tool Parts

Tool parts have the following keys in JSON:

  • type: always tconstruct:tool_part
  • stat_type (resource location): ID of a material stat ID for the type of the part. Default types include tconstruct:head, tconstruct:handle, tconstruct:extra, tconstruct:limb, tconstruct:grip, and tconstruct:bowstring

Tool parts are the only items valid for usage in tool definitions of multipart tools

Repair Kits

Example

repair kits have the following keys in JSON:

  • type: always tconstruct:repair_kit
  • repair_amount (float): number of "ingots" this repair kit is equivalent to. Does not need to be the same as the cost in recipes.

Once added, a repair kit will automatically be usable for repairing tools.

Tools

Custom tools is the main feature gained from Json Things. There are three tool types and three armor types included in the mod. Most of the tool's behavior is controlled in the tool definition, hence these JSON files being relatively light.

All tool types support the resource location stat_provider, which can be set to one of the following default providers (addons can add more):

  • tconstruct:no_parts: General provider that works on any tool type, for a tool with flat stats.
  • tconstruct:melee_harvest: Provider that uses tconstruct:head, tconstruct:handle and tconstruct:extra parts to produce harvest speed, attack damage, harvest tier, attack speed, and durability on tools
  • tconstruct:ranged: Provider that uses tconstruct:limb, tconstruct:grip, and tconstruct:bowstring parts to produce draw speed, velocity, accuracy, and durability on tools

In addition, it is recommended to set "color_handler": "tconstruct:tool" on all tools to ensure modifiers are properly colored.

Common JSON Files

Under assets, most tools need:

  • A model using the tconstruct:tool loader
  • Textures under textures/item
  • A name in language
  • For multipart tools, a description in lanaguage

Under data, most tools need:

  • a tool definition, under tinkering/tool_definitions
  • if multipart, tool station layout, under tinkering/station_layouts
  • various tags to make modifiers and other functionality work, all relevant tags should be under data/tconstruct/tags/items/modifiable
  • a tool building recipe (there is a custom serializer for multipart, while any recipe serializer works for no part tools)
  • if not multipart, tool repair recipes (one for repair kits in the crafting table, one for general repair in the tinker station)

Basic Tool

Example No Parts Example Melee Harvest

tconstruct:tool is a basic tool type, used in the base mod for most tool types including pickaxes, shovels, and flint and brick.

In addition to stat_provider and color_handler, there are the following keys:

  • type: always tconstruct:tool
  • break_blocks_in_creative (boolean): set to false on melee items to prevent block breaking in creative, typically used on swords

Bow

Example

tconstruct:bow is a basic ranged weapon that is drawn back and released to fire.

In addition to stat_provider and color_handler, there are the following keys:

  • type: always tconstruct:bow

Crossbow

Example

tconstruct:cross is a ranged weapon that loads ammo when drawn back, firing on next usage

In addition to stat_provider and color_handler, there are the following keys:

  • type: always tconstruct:crossbow
  • allow_fireworks (boolean): If true, this crossbow can be loaded with fireworks. If false, only arrows are allowed

Armor

There are three different armor item types that can be chosen. In addition to stat_provider and color_handler, armor types share the following keys:

  • texture_name (resource location): determines the texture chosen from assets/<pack id>/textures/model/armor/, referenced as <texture domain> and <texture path> below
  • slot (string): can be helmet, chestplate, leggings, or boots to determine where the armor is worn
  • equip_sound (resource location): sound to play when putting on the armor

For the item form, dyed textures and embellishment textures are added as part of modifier textures. The tool part generator work on the embellishment texture.

Basic Armor

Basic armor is for armor with a single texture, or optionally a second to allow dyeable armor. In the base mod, travelers gear uses this type. tconstruct:basic_armor supports the following additional keys:

  • type: always tconstruct:basic_armor
  • dyeable (boolean): If true, the armor will be two layer, with a base layer and a dyed overlay. If false, the armor will be one layer

The base layer will be located at assets/<texture domain>/textures/model/armor/<texture path>_layer_1 and assets/<texture domain>/textures/model/armor/<texture path>_layer_2 when not golden. When the golden modifier is applied, the base layer is instead pulled from assets/<texture domain>/textures/model/armor/<texture path>_golden_1 and assets/<texture domain>/textures/model/armor/<texture path>_golden_2.

If dyeable and the armor has been dyed, the overlays will be pulled from assets/<texture domain>/textures/model/armor/<texture path>_overlay_1 and assets/<texture domain>/textures/model/armor/<texture path>_overlay_2, then tinted the appropriate color.

Layered Embellished Armor

Layered embellished armor is for armor with a base texture and an overlay determined by embellishments. In the base mod, plate armor uses this type. tconstruct:layered_embellished_armor supports the following additional keys:

  • type: always tconstruct:layered_embellished_armor

The base layer will be located at assets/<texture domain>/textures/model/armor/<texture path>_layer_1 and assets/<texture domain>/textures/model/armor/<texture path>_layer_2 always. The base embellishment texture is located at assets/<texture domain>/textures/model/armor/<texture path>/layer_1 and assets/<texture domain>/textures/model/armor/<texture path>/layer_2, which can be added to Generator Part Textures to generate additional textures, including golden (see command). Note at this time, it is not possible to create a new embellishment type, so you are limited to tconstruct:plate or tconstruct:slime

Flat Embellished Armor

Example

Single layer embellished armor with a base texture determined by embellishments. The advantage of this type is it supports an optional dyeable overlay texture. In the base mod, slime suit uses this type. tconstruct:flat_embellished_armor supports the following additional keys:

  • type: always tconstruct:flat_embellished_armor
  • dyeable (boolean): If true, the armor will be two layer, with a base layer and a dyed overlay. If false, the armor will be one layer
  • default_material (resource location): ID of the material to use when not embellished. For reference, slime suit defaults to tconstruct:enderslime

The base embellishment texture is located at assets/<texture domain>/textures/model/armor/<texture path>/layer_1 and assets/<texture domain>/textures/model/armor/<texture path>/layer_2, which can be added to Generator Part Textures to generate additional textures, including golden (see command).

If dyeable, the overlays will be pulled from assets/<texture domain>/textures/model/armor/<texture path>_overlay_1 and assets/<texture domain>/textures/model/armor/<texture path>_overlay_2, then tinted the appropriate color. If not dyed, the overlay will be applied white. There are plans in the future to support a different default color.

Clone this wiki locally