Modifier slot types are used in modifier recipes in Tinkers’ Construct to allow limiting some more powerful modifier while leaving other, weaker modifiers a large number of slots. All modifiers recipes to add modifiers to a tool must select a slot type.

Slot Types

By default, the following slot types are available:

  • upgrades: Common modifier slot for low cost modifier recipes. Tools have many upgrade slots and can receive many more.
  • abilities: Rare modifier slot for high cost or high impact modifiers. Tools have few ability slots and adding more is expensive.
  • defense: Uncommon modifier slots available on most forms of armor. While armor tends to have more defense slots than ability slots, there is only 1 way to gain an additional defense slot.
  • soul: Currently unused slot type intended for future content.

In addition, many contexts refer to a slot type of “slotless”, which is used for recipes that require no slots. While not a slot type, some contexts use slotless as the ID for this concept, such as textures in JEI.

Custom Slots

Beyond the default types, both addons and data packs can freely define additional slot types, provided they also define a way to obtain the slots on tools using modifiers or tool starting slots.

For addons, slots can be defined using the methods in SlotType:

  • getOrCreate(String name): Gets a slot type by the given name, or creates it if absent. Name should only consistent of lowercase letters, numbers, and underscores.
  • getIfPresent(String name): Returns the slot if any mod created it previously, or null if uncreated.

Before 1.20, slot colors were defined in Java using the following method. Since 1.20, colors are defined in resource packs as described below.

  • create(String name, int color): Defines a new slot type with the given color. If two slots are declared with the same name, the first instance is returned and the color is ignored.

For data packs, a slot is defined simply by using it in any relevant context, such as modifier recipes or modifiers.

Slot IDs are intentionally not namespaced to encourage reuse among addons and datapacks. If you make an addon with a custom slot type that other addons may with to use, discuss it with us and we can mention it on this page.

Language keys

Whichever method used, language keys are consistent. To make a custom slot properly show up in translations, three language file keys are needed. In all examples, <id> should be replaced with the actual ID of the trait.

  • item.tconstruct.creative_slot.<id>: Name of the creative modifier to add an extra slot of this type.
  • stat.tconstruct.slot.prefix.<id>: Slot name for remaining slots in tooltips. Should end in a colon and space for consistency.
  • stat.tconstruct.slot.display.<id>: Slot name for formatting in tooltips. Inserted into several translation strings that describe slot types.
  • modifier.tconstruct.rebalanced.<id>: Slot name for formatting the rebalanced modifier.

For example, for upgrades:

{
  "item.tconstruct.creative_slot.upgrades": "Creative Upgrade Slot",
  "stat.tconstruct.slot.prefix.upgrades": "Upgrades: ",
  "stat.tconstruct.slot.display.upgrades": "upgrade",
  "modifier.tconstruct.rebalanced.upgrades": "Upgrade"
}

1.21 reworked the language keys slightly, allowing more places in code to choose either upper or lowercase names with the following keys:

  • stat.tconstruct.slot.lower.<id>: Lowercase slot name for formatting in tooltips. Typically used for strings like “Grants 1 slot".
  • stat.tconstruct.slot.upper.<id>: Uppercase slot name for formatting names. Used notably for variants of the rebalanced modifier.

For example, for upgrades:

{
  "item.tconstruct.creative_slot.upgrades": "Creative Upgrade Slot",
  "stat.tconstruct.slot.prefix.upgrades": "Upgrades: ",
  "stat.tconstruct.slot.lower": "upgrade",
  "stat.tconstruct.slot.upper.upgrades": "Upgrade"
}

Color

Since 1.20, slot type colors are defined using resource colors with a key of stat.tconstruct.slot.<id> for the slot <id>. For example, the following JSON would define all the colors for slot types added by Tinkers’ Construct:

{
  "stat.tconstruct.slot": {
    "upgrades":  "#CCBA47",
    "defense":   "#A8FFA0",
    "abilities": "#B8A0FF"
  }
}

Before 1.20, color was defined in the slot constructor, so datapack added slots all had the default white color.

Textures

Slot types require a texture which is used both for the creative slot modifier, and in JEI integration to show slot cost. If a texture is not defined, it will fallback to the slotless book icon. Internally, JEI integration uses the textures from the item model to define.

Icons can be defined using in a resource pack under assets/tconstruct/mantle/textures/creative_slot.json. The format is essentially just the textures part of a model JSON:

  • (Object): The root object.
    • textures (Object): Map of textures
      • <slot> (Resource Location): Sets the texture for <slot> to the given texture, relative to assets/<domain>/textures.

For example, the following JSON would define all the textures for slot types added by Tinkers’ Construct:

{
  "textures": {
    "upgrades":  "tconstruct:item/slot/upgrade",
    "abilities": "tconstruct:item/slot/ability",
    "defense":   "tconstruct:item/slot/defense"
  }
}

In this example, upgrades is the key for the upgrade slot, which has a texture located at assets/tconstruct/textures/item/slot/upgrade.png.

Before 1.20

The Mantle texture map system was added in 1.20 as part of a later Mantle update. Before that update, it was necessary to add textures either in Java or by overriding the model (making it only viable for modpacks).

For a modpack, they were required to create a resource pack to override the default icons. These are defined in assets/tconstruct/models/item/creative_slot.json. The textures JSON object contains a mapping from slot ID to texture in the standard resource pack format. Copying this file and adding the additional textures will allow the new slots to have icons, but importantly this can only be done once (so any mods doing this will conflict with other mods doing it).

For addons, more textures can be added via Mantle’s NBTKeyModel.registerExtraTexture(ResourceLocation key, String textureName, ResourceLocation texture). The following parameters are wanted:

  • key should be passed as tconstruct:creative_slot
  • textureName should be the ID of your modifier slot
  • texture should be the texture path in standard model resource pack format.

There was no mechanism in place to add textures for new slot types in a JSON addon.

Slot Count

Slot types are commonly used in slot count objects, to define the count for various slots. This may be used for a slot requirement or a slot reward. Typically, it has the following format:

For example, { "upgrades": 3 } represents a slot count of 3 upgrades. In most cases, a slot count may only have 1 type of slot specified, and leaving the object out represents no slots.