DataComponentMap

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

Implements

Undocumented Interfaces

Iterable<TypedDataComponent<?>>

Operators

in(type as DataComponentType<?>) as bool
script.zs
// ((type as DataComponentType<?>) in DataComponentMap) as bool
myDataComponentType<?> in myDataComponentMap

Parameters:

Return Type: bool

Members

static builder() as Builder
script.zs
// DataComponentMap.builder() as DataComponentMapBuilder;
DataComponentMap.builder();

Return Type: DataComponentMapBuilder

static composite(a as DataComponentMap, b as DataComponentMap) as DataComponentMap
script.zs
// DataComponentMap.composite(a as DataComponentMap, b as DataComponentMap) as DataComponentMap;
DataComponentMap.composite(myDataComponentMap, myDataComponentMap);

Return Type: DataComponentMap

getComponent(type as DataComponentType<T>) as T?
script.zs
// DataComponentMap.getComponent<T>(type as DataComponentType<T>) as T?;
myDataComponentMap.getComponent<T>(myDataComponentType);

Parameters:

Return Type: T?

getOrDefault(type as DataComponentType<T>, defaultValue as T) as T
script.zs
// DataComponentMap.getOrDefault<T>(type as DataComponentType<T>, defaultValue as T) as T;
myDataComponentMap.getOrDefault<T>(myDataComponentType, myT);

Parameters:

defaultValue Type: T

Return Type: T

getTyped(type as DataComponentType<T>) as TypedDataComponent<T>
script.zs
// DataComponentMap.getTyped<T>(type as DataComponentType<T>) as TypedDataComponent<T>;
myDataComponentMap.getTyped<T>(myDataComponentType);

Parameters:

Return Type: TypedDataComponent<T>

has(type as DataComponentType<?>) as bool
script.zs
// DataComponentMap.has(type as DataComponentType<?>) as bool;
myDataComponentMap.has(myDataComponentType);

Parameters:

Return Type: bool

Getter
script.zs
// DataComponentMap.isEmpty as bool
myDataComponentMap.isEmpty

Return Type: bool

Getter
script.zs
// DataComponentMap.keySet as Set<DataComponentType<?>>
myDataComponentMap.keySet

Return Type: Set<DataComponentType<?>>

Getter
script.zs
// DataComponentMap.list as List<TypedDataComponent<?>>
myDataComponentMap.list

Return Type: List<TypedDataComponent<?>>

Getter
script.zs
// DataComponentMap.size as int
myDataComponentMap.size

Return Type: int