MutableDataComponentHolder

Link to mutabledatacomponentholder

An interface that stores DataComponents

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.neoforge.api.component.MutableDataComponentHolder;

Implemented Interfaces

Link to implemented-interfaces

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

Name: applyComponents

ZenScript
Copy
MutableDataComponentHolder.applyComponents(components as DataComponentMap)
ParameterType
Parameter
components
Type
DataComponentMap

Name: applyComponents

ZenScript
Copy
MutableDataComponentHolder.applyComponents(patch as DataComponentPatch)
ParameterType
Parameter
patch
Type
DataComponentPatch

Name: copyFrom

ZenScript
Copy
MutableDataComponentHolder.copyFrom(src as DataComponentHolder, componentTypes as DataComponentType[])
ParameterType
Parameter
src
Type
DataComponentHolder
Parameter
componentTypes
Type
DataComponentType[]

Name: remove

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

ZenScript
Copy
MutableDataComponentHolder.remove<T : Object>(componentType as DataComponentType<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
componentType
Type
DataComponentType<T>
Parameter
T
Type
Object

Name: setComponent

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

ZenScript
Copy
MutableDataComponentHolder.setComponent<T : Object>(componentType as DataComponentType<T>, value as @org.openzen.zencode.java.ZenCodeType.Nullable T) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
componentType
Type
DataComponentType<T>
Parameter
value
Type
@org.openzen.zencode.java.ZenCodeType.Nullable T
Parameter
T
Type
Object

Name: update

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

ZenScript
Copy
MutableDataComponentHolder.update<T : Object>(componentType as DataComponentType<T>, value as T, updater as UnaryOperator<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
componentType
Type
DataComponentType<T>
Parameter
value
Type
T
Parameter
updater
Type
UnaryOperator<T>
Parameter
T
Type
Object

Name: update

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

ZenScript
Copy
MutableDataComponentHolder.update<T : Object, U : Object>(componentType as DataComponentType<T>, value as T, updateContext as U, updater as BiFunction<T,U,T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
ParameterType
Parameter
componentType
Type
DataComponentType<T>
Parameter
value
Type
T
Parameter
updateContext
Type
U
Parameter
updater
Type
BiFunction<T,U,T>
Parameter
T
Type
Object
Parameter
U
Type
Object