CustomData

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.item.component.CustomData;

Operators

in(key as string) as bool
script.zs
// ((key as string) in CustomData) as bool
myString in myCustomData

Parameters:

key Type: string

Return Type: bool

Members

contains(key as string) as bool
script.zs
// CustomData.contains(key as string) as bool;
myCustomData.contains(myString);

Parameters:

key Type: string

Return Type: bool

Getter
script.zs
// CustomData.copyTag as CompoundTag
myCustomData.copyTag

Return Type: CompoundTag

Getter
script.zs
// CustomData.isEmpty as bool
myCustomData.isEmpty

Return Type: bool

matchedBy(tag as MapData) as bool
script.zs
// CustomData.matchedBy(tag as MapData) as bool;
myCustomData.matchedBy(myMapData);

Parameters:

tag Type: MapData

Return Type: bool

static of(tag as MapData) as CustomData
script.zs
// CustomData.of(tag as MapData) as CustomData;
CustomData.of(myMapData);

Parameters:

tag Type: MapData

Return Type: CustomData

Getter
script.zs
// CustomData.size as int
myCustomData.size

Return Type: int

update(updater as function(t as MapData) as void) as CustomData
script.zs
// CustomData.update(updater as function(t as MapData) as void) as CustomData;
myCustomData.update(myConsumer);

Parameters:

updater Type: function(t as MapData) as void

Return Type: CustomData