TypedDataComponent

Link to typeddatacomponent

Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.component.TypedDataComponent;

Extending Record

Link to extending-record

TypedDataComponent extends Record. That means all methods available in Record are also available in TypedDataComponent

Name: of

Return Type: TypedDataComponent<T>

ZenScript
Copy
TypedDataComponent.of<T : Object>(type as DataComponentType<T>, value as T) as TypedDataComponent<T>
ParameterType
Parameter
type
Type
DataComponentType<T>
Parameter
value
Type
T
Parameter
T
Type
Object
Result TypeIs Implicit
Result Type
IData
Is Implicit
true

Name: applyTo

ZenScript
Copy
TypedDataComponent.applyTo<T : Object>(patchedMap as invalid)
ParameterType
Parameter
patchedMap
Type
invalid
Parameter
T
Type
Object

Name: asIData

Return Type: IData

ZenScript
Copy
// TypedDataComponent.asIData() as IData

myTypedDataComponent.asIData();

Name: type

Return Type: DataComponentType<T>

ZenScript
Copy
TypedDataComponent.type<T : Object>() as DataComponentType<T>
ParameterType
Parameter
T
Type
Object

Name: value

Return Type: T

ZenScript
Copy
TypedDataComponent.value<T : Object>() as T
ParameterType
Parameter
T
Type
Object
NameTypeHas GetterHas Setter
Name
registryName
Type
ResourceLocation
Has Getter
true
Has Setter
false