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 Copyimport 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
- stdlib.Iterable<TypedDataComponent>
Static Methods
Link to static-methods
Name: builder
Return Type: DataComponentMapBuilder
ZenScript Copy// DataComponentMap.builder() as DataComponentMapBuilder
DataComponentMap.builder();
Name: composite
Return Type: DataComponentMap
ZenScript CopyDataComponentMap.composite(a as DataComponentMap, b as DataComponentMap) as DataComponentMap
Parameter | Type |
---|---|
Parameter a | Type DataComponentMap |
Parameter b | Type DataComponentMap |
Methods
Link to methods
Name: getComponent
Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T
ZenScript CopyDataComponentMap.getComponent<T : Object>(type as DataComponentType<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
Parameter | Type |
---|---|
Parameter type | Type DataComponentType<T> |
Parameter T | Type Object |
Name: getOrDefault
Return Type: T
ZenScript CopyDataComponentMap.getOrDefault<T : Object>(type as DataComponentType<T>, defaultValue as T) as T
Parameter | Type |
---|---|
Parameter type | Type DataComponentType<T> |
Parameter defaultValue | Type T |
Parameter T | Type Object |
Name: getTyped
Return Type: TypedDataComponent<T>?
ZenScript CopyDataComponentMap.getTyped<T : Object>(type as DataComponentType<T>) as TypedDataComponent<T>?
Parameter | Type |
---|---|
Parameter type | Type DataComponentType<T> |
Parameter T | Type Object |
Name: has
Return Type: boolean
ZenScript CopyDataComponentMap.has(type as DataComponentType) as boolean
Parameter | Type |
---|---|
Parameter type | Type DataComponentType |
Properties
Link to properties
Name | Type | Has Getter | Has 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 |