TypedDataComponent

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.component.TypedDataComponent;

Members

applyTo(patchedMap as PatchedDataComponentMap)
script.zs
// TypedDataComponent<T>.applyTo<T>(patchedMap as PatchedDataComponentMap);
myTypedDataComponent.applyTo<T>(myPatchedDataComponentMap);

Parameters:

patchedMap Type: PatchedDataComponentMap
asIData() as IData
script.zs
// TypedDataComponent<T>.asIData() as IData;
myTypedDataComponent.asIData();

Return Type: IData

implicit as IData
script.zs
// TypedDataComponent<T> as IData
myTypedDataComponent as IData

Return Type: IData

static of<T>(type as DataComponentType<T>, value as T) as TypedDataComponent<T>
script.zs
// TypedDataComponent<T>.of<T>(type as DataComponentType<T>, value as T) as TypedDataComponent<T>;
TypedDataComponent<T>.of<T>(myDataComponentType, myT);

Parameters:

value Type: T

Return Type: TypedDataComponent<T>

Getter
script.zs
// TypedDataComponent<T>.registryName as ResourceLocation
myTypedDataComponent.registryName

Return Type: ResourceLocation

type() as DataComponentType<T>
script.zs
// TypedDataComponent<T>.type<T>() as DataComponentType<T>;
myTypedDataComponent.type<T>();

Return Type: DataComponentType<T>

value() as T
script.zs
// TypedDataComponent<T>.value<T>() as T;
myTypedDataComponent.value<T>();

Return Type: T