Skip to content

Getting Started

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

English | 中文

Getting Started

Where scripts go and when they apply

Content Script folder How to apply changes
Item registration (tools, parts, bows, armor), stat types, armor sets kubejs/startup_scripts Restart the game
Recipes, material data, material tags, modifier data, tool stats kubejs/server_scripts /reload
Logic inside modifier events and global tool stat events kubejs/server_scripts /kubejs reload server_scripts
Client-side material variants kubejs/client_scripts F3+T
Textures kubejs/assets/<namespace>/textures/ F3+T

When you only changed event logic, prefer /kubejs reload server_scripts. It is much faster than /reload, which also forces JEI to rebuild everything and can take a long time in large modpacks.

Names, colors and appearance of materials and modifiers defined in server scripts are synced to clients over the network, so you do not need to repeat them in client scripts. Clients must have this mod installed.

Global names

Everything this mod exposes to scripts starts with Arsenal:

Name What it is
ArsenalMaterialEvents Event group: materials, material tags, stat types, client material appearance
ArsenalModifierEvents Event group: modifier definitions and modifier events
ArsenalToolEvents Event group: tool stats, global tool stats, armor sets
ArsenalRecipes Batch metal recipes
ArsenalFluids Fluid amount constants
ArsenalTool Query modifiers on tools, read and write tool data

Recipes live under KubeJS's event.recipes.tconstruct.*.

Complete small example: a mythril war axe

startup_scripts/demo.js:

// New part: great blade (uses the Tinkers head stat, costs 4 ingots, has casts)
StartupEvents.registry('item', event => {
  event.create('kubejs:great_blade', 'tinkers_kubejs_arsenal:part')
    .statType('head')
    .cost(4)
    .casts()
    .displayName('Great Blade')
    .name('zh_cn', '巨刃')

  // New tool: war axe = great blade + tough handle
  event.create('kubejs:war_axe', 'tinkers_kubejs_arsenal:tool')
    .part('blade', 'kubejs:great_blade')
    .part('handle', 'tconstruct:tough_handle')
    .brokenPart('blade')
    .displayName('War Axe')
    .name('zh_cn', '战斧')
})

server_scripts/demo.js:

// New material: mythril
ArsenalMaterialEvents.data(event => {
  event.create('kubejs:mythril')
    .tier(3)
    .head(600, 7.5, 'minecraft:diamond', 3)
    .handle(0.1, 0.05, 0, 0)
    .trait('tconstruct:magnetic', 1)
    .color('6FD0E8')
    .fallbacks('metal')
    .generator('tconstruct:head', 'tconstruct:handle')
    .name('Mythril').name('zh_cn', '秘银')
})

// War axe stats
ArsenalToolEvents.data(event => {
  event.create('kubejs:war_axe')
    .baseStat('attack_damage', 3)
    .baseStat('attack_speed', 0.9)
    .multiplyStat('durability', 1.3)
    .slot('upgrades', 2)
    .slot('abilities', 1)
    .toolActions('axe_dig')
    .effective('minecraft:mineable/axe')
    .modifiable('melee/weapon', 'harvest/primary', 'small')
})

// Diamonds become mythril material in the Part Builder
ServerEvents.recipes(event => {
  event.recipes.tconstruct.material('minecraft:diamond', 'kubejs:mythril')
})

You also need a few textures, such as kubejs/assets/kubejs/textures/item/part/great_blade.png and item/tool/war_axe/blade.png. See Textures.

ProbeJS

With ProbeJS installed, material IDs, modifier IDs, tool stat IDs, slot types, part items and other parameters get autocompletion.

Clone this wiki locally