DataComponentPatch

Link to datacomponentpatch

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.DataComponentPatch;

Name: builder

Return Type: DataComponentPatchBuilder

ZenScript
Copy
// DataComponentPatch.builder() as DataComponentPatchBuilder

DataComponentPatch.builder();

Name: forget

Return Type: DataComponentPatch

ZenScript
Copy
DataComponentPatch.forget<T : Object>(component as DataComponentType<T>) as DataComponentPatch
ParameterType
Parameter
component
Type
DataComponentType<T>
Parameter
T
Type
Object

Name: getComponent

Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T

ZenScript
Copy
DataComponentPatch.getComponent<T : Object>(type as DataComponentType<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
type
Type
DataComponentType<T>
Parameter
T
Type
Object

Name: split

Return Type: DataComponentPatchSplitResult

ZenScript
Copy
// DataComponentPatch.split() as DataComponentPatchSplitResult

myDataComponentPatch.split();
NameTypeHas GetterHas Setter
Name
isEmpty
Type
boolean
Has Getter
true
Has Setter
false
Name
size
Type
int
Has Getter
true
Has Setter
false