Skip to content

Materials

hp-1e edited this page Oct 31, 2026 · 1 revision

English | 中文

Materials

Materials are defined in server_scripts with ArsenalMaterialEvents.data and apply after /reload. Appearance data such as names, colors and texture generators is synced from the server to clients, so you do not need a client script for it.

Creating a material

ArsenalMaterialEvents.data(event => {
  event.create('kubejs:mythril')
    .tier(3)
    .sortOrder(50)
    .craftable(true)
    .rarity('rare')
    .head(600, 7.5, 'minecraft:diamond', 3)
    .handle(0.1, 0.05, 0, 0)
    .binding()
    .trait('tconstruct:magnetic', 1)
    .statTrait('tconstruct:armor', 'tconstruct:revitalizing', 1)
    .color('6FD0E8')
    .fallbacks('metal')
    .luminosity(4)
    .generator('tconstruct:head', 'tconstruct:handle', 'tconstruct:binding')
    .textColor('7FE0F8')
    .name('Mythril').name('zh_cn', '秘银')
    .flavor('Light as a feather, hard as dragon scale')
    .encyclopedia('Mythril is a rare magical metal...')
})

Basics

Method Description
.tier(n) Material tier
.sortOrder(n) Sort order
.craftable(bool) Whether it can be crafted in the Part Builder from material items
.hidden(bool) Hide it from the book and JEI
.rarity(value) common uncommon rare epic

Part stats (23 types)

Group Methods
Melee and harvest .head(durability, miningSpeed, miningTier, attack) .handle(durability, miningSpeed, attackSpeed, attack) .binding()
Ranged .limb(durability, drawSpeed, velocity, accuracy) .grip(durability, accuracy, attack) .bowstring()
Armor .platingHelmet .platingChestplate .platingLeggings .platingBoots, each (durability, armor, toughness, knockbackResistance); .platingShield(durability, toughness, knockbackResistance); .maille() .shieldCore() .cuirass()
Ammo .arrowHead() .arrowShaft() .fletching()
Slimesuit .skull(durability, armor) .slime(durability, overslimeCapacity) .ribcage(repairAmount) .shell(repairAmount) .laces(repairAmount) .repairKit()
  • handle and grip durability, speed and similar values are percentage bonuses: 0.1 means +10% and -0.2 means -20%, the same as in Tinkers datapacks.
  • The mining tier is a vanilla or Tinkers tier ID, such as minecraft:iron, minecraft:diamond or minecraft:netherite.
  • For stat types from other mods use .stat(statId, {field: value}). For stat types registered with this mod use .customStat(...); see Stat Types.

Traits

Method Description
.trait(modifier[, level]) Default trait, applies to every part
.statTrait(statTypeOrGroup, modifier, level) Applies only to one kind of part. Groups: tconstruct:melee_harvest, tconstruct:ranged, tconstruct:armor, tconstruct:ammo

Once a kind of part has statTrait entries, it uses only that list and no longer adds the default traits. This is how Tinkers' Construct works.

Appearance

Method Description
.color('RRGGBB') Material color
.fallbacks(...) Fallback textures: bone cloth contrast crystal metal metal_contrast primitive rock slime_metal slime_wood stick vine wood
.luminosity(0-15) Glow level
.texture(id) Override the texture suffix
.generator(statTypes...) Generate detailed part textures for the listed stat types, with a palette derived from .color
.generator({...}) Raw Tinkers generator config; needs transformer and supported_stats
.generatorPalette({'063': 'FF102030', ...}) Custom palette keyed by grey value
.textColor('RRGGBB') Tooltip text color
.name/.flavor/.encyclopedia([lang,] text) Name, flavor line and book text; English when no language is given

Detailed textures are generated on the client while resources load, so you do not need to run the Tinkers texture generation command. Materials without .generator are tinted with their fallback textures.

Making a material obtainable

A material has no source by itself. Add recipes (see Recipes):

ServerEvents.recipes(event => {
  // Item → material (Part Builder)
  event.recipes.tconstruct.material('kubejs:mythril_ingot', 'kubejs:mythril')
  // Fluid → material (casting parts)
  event.recipes.tconstruct.material_fluid('kubejs:mythril').fluid('kubejs:molten_mythril', 90).temperature(900)
  // Material → fluid (melting parts and tools)
  event.recipes.tconstruct.material_melting('kubejs:mythril', Fluid.of('kubejs:molten_mythril', 90))
})

Extending existing materials

ArsenalMaterialEvents.data(event => {
  event.extend('tconstruct:iron')
    .customStat('kubejs:blade', 2, 0, 250)
    .statTrait('kubejs:blade', 'tconstruct:sharpness', 1)
})

extend only adds stats; the original data stays intact. Only part stat methods and .statTrait are allowed here. .trait, appearance, text and .tier would replace the original material's data, so they throw an error inside extend.

Material tags

ArsenalMaterialEvents.tags(event => {
  event.create('kubejs:magic_metals')
    .add('kubejs:mythril')
    .addAll('tconstruct:cobalt', 'tconstruct:manyullyn')
    .addOptional('othermod:adamant')
    .replace(false)
})

Tag entries must be base material IDs; #variant is not allowed.

Material variants (client)

Variants only change appearance; stats and traits come from the base material. Write them in client_scripts, apply with F3+T:

ArsenalMaterialEvents.assets(event => {
  event.create('kubejs:mythril#polished')
    .color('A0F0FF')
    .fallbacks('metal')
    .generator('tconstruct:head')
    .name('Polished Mythril').name('zh_cn', '抛光秘银')
})

Clone this wiki locally