DataComponentPatchBuilder
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.
import crafttweaker.api.component.DataComponentPatchBuilder;Members
build() as DataComponentPatch
Builds the script.zs
DataComponentPatch.Returns: The DataComponentPatch.
myBuilder.build();
Return Type:
DataComponentPatch
remove(type as DataComponentType<T>) as Builder
Removes the script.zs
DataComponentType from the DataComponentPatch.Builder.Returns: The DataComponentPatch.Builder with the DataComponentType removed.
myBuilder.remove<T>(myDataComponentType);Parameters:
Return Type:
DataComponentPatchBuilder
setComponent(type as DataComponentType<T>, value as T) as Builder
Sets the value for the given script.zs
DataComponentType.Returns: The DataComponentPatch.Builder with the value set.
myBuilder.setComponent<T>(myDataComponentType, myT);Parameters:
Return Type:
DataComponentPatchBuilder
setComponent(type as TypedDataComponent<T>) as Builder
Sets the script.zs
TypedDataComponent for the given DataComponentType.Returns: The DataComponentPatch.Builder with the TypedDataComponent set.
myBuilder.setComponent<T>(myTypedDataComponent);Parameters:
type: TypedDataComponent<T> Type: TypedDataComponent<T>
- The DataComponentType to set the TypedDataComponent for.
Return Type:
DataComponentPatchBuilder