DataComponentMapBuilder
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.DataComponentMapBuilder;
Implements
Undocumented Interfaces
IDataComponentMapBuilderExtensions
Members
addAll(other as DataComponentMap) as Builder
Adds all the script.zs
DataComponentType
s and values from the other DataComponentMap
to the builder.Returns: The DataComponentMap.Builder with the added values.
myBuilder.addAll(myDataComponentMap);
Parameters:
other: DataComponentMap
Type: DataComponentMap
- The DataComponentMap
to add the DataComponentType
s and values from.
Return Type:
DataComponentMapBuilder
build() as DataComponentMap
Builds the script.zs
DataComponentMap
.Returns: The built DataComponentMap
.
myBuilder.build();
Return Type:
DataComponentMap
setComponent(type as DataComponentType<T>, value as T?) as Builder
Sets the value of the data component for the given script.zs
DataComponentType
.Returns: The DataComponentMap.Builder with the updated value.
myBuilder.setComponent<T>(myDataComponentType, myT);
Parameters:
value: T?
Type: T?
- The value to set the data component to.
Return Type:
DataComponentMapBuilder