Home Getting Started With Scripts Using this wiki Commands CTGUI Global functions Bracket Handlers

Trait Data Representation

A Trait data representation represents a Tinkers’ Construct Trait’s Data and is ItemBound.
You can get such an object from an existing Trait object by supplying an IItemStack to the getData method.

Importing the class

It might be required for you to import the class if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import mods.contenttweaker.tconstruct.TraitDataRepresentation

ZenGetter and ZenSetter

NameZenGetterZenSetterType
Name
color
ZenGetter
ZenSetter
Type
int
Name
current
ZenGetter
ZenSetter
Type
int
Name
extraInfo
ZenGetter
ZenSetter
Type
string
Name
identifier
ZenGetter
ZenSetter
Type
string
Name
level
ZenGetter
ZenSetter
Type
int
Name
max
ZenGetter
ZenSetter
Type
int
Name
info
ZenGetter
ZenSetter
Type
string
Name
colorString
ZenGetter
ZenSetter
Type
string

ZenMethods

script.zs
//Does the same as myTraitData.info;
myTraitData.calcInfo();
//Does the same as myTraitData.colorString;
myTraitData.getColorString();