DataComponentMap

Link to datacomponentmap

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

Implemented Interfaces

Link to implemented-interfaces

DataComponentMap implements the following interfaces. That means all methods defined in these interfaces are also available in DataComponentMap

Name: builder

Return Type: DataComponentMapBuilder

ZenScript
Copy
// DataComponentMap.builder() as DataComponentMapBuilder

DataComponentMap.builder();

Name: composite

Return Type: DataComponentMap

ZenScript
Copy
DataComponentMap.composite(a as DataComponentMap, b as DataComponentMap) as DataComponentMap
ParameterType
Parameter
a
Type
DataComponentMap
Parameter
b
Type
DataComponentMap

Name: getComponent

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

ZenScript
Copy
DataComponentMap.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: getOrDefault

Return Type: T

ZenScript
Copy
DataComponentMap.getOrDefault<T : Object>(type as DataComponentType<T>, defaultValue as T) as T
ParameterType
Parameter
type
Type
DataComponentType<T>
Parameter
defaultValue
Type
T
Parameter
T
Type
Object

Name: getTyped

Return Type: TypedDataComponent<T>?

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

Name: has

Return Type: boolean

ZenScript
Copy
DataComponentMap.has(type as DataComponentType) as boolean
ParameterType
Parameter
type
Type
DataComponentType
NameTypeHas GetterHas Setter
Name
isEmpty
Type
boolean
Has Getter
true
Has Setter
false
Name
keySet
Type
Set<DataComponentType>
Has Getter
true
Has Setter
false
Name
list
Type
stdlib.List<TypedDataComponent>
Has Getter
true
Has Setter
false
Name
size
Type
int
Has Getter
true
Has Setter
false