Tetradatakubejs Wiki › Guides › Create a Custom Tetra Material with Stats
Create a Custom Tetra Material with Stats
Setting Up Your Material Script
Create a new .js file in your kubejs/server_scripts folder. This is where you'll define your custom material using the KubeJS + Tetra integration.
Defining the Material
Use hp_TetraDataEvents.queue() to register your material. Inside the queue function, specify:
- Material name: A unique identifier for your material (e.g.,
'mithril') - Base stats: Properties like durability, damage, speed, and enchantability that define how tools perform
- Tool tier: Which tier of tools can use this material (affects what schematics accept it)
- Color: A hex value for the material's appearance in-game
- Texture or appearance settings: How the material looks when applied to gear
The mod provides code completion hints as you type, so your editor will suggest valid stat names and effect types.
Testing Your Changes
Save your script file, then run /reload or /hp_tetra_data_kubejs apply in your world. The command injects your staged data immediately. Load a workbench and check if your material appears in the material selection menu when crafting tools.