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 Copyimport 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
Methods
Link to methods
Name: applyComponents
ZenScript CopyMutableDataComponentHolder.applyComponents(components as DataComponentMap)
Parameter | Type |
---|---|
Parameter components | Type DataComponentMap |
Name: applyComponents
ZenScript CopyMutableDataComponentHolder.applyComponents(patch as DataComponentPatch)
Parameter | Type |
---|---|
Parameter patch | Type DataComponentPatch |
Name: copyFrom
ZenScript CopyMutableDataComponentHolder.copyFrom(src as DataComponentHolder, componentTypes as DataComponentType[])
Parameter | Type |
---|---|
Parameter src | Type DataComponentHolder |
Parameter componentTypes | Type DataComponentType[] |
Name: remove
Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T
ZenScript CopyMutableDataComponentHolder.remove<T : Object>(componentType as DataComponentType<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
Parameter | Type |
---|---|
Parameter componentType | Type DataComponentType<T> |
Parameter T | Type Object |
Name: setComponent
Return Type: @org.openzen.zencode.java.ZenCodeType.Nullable T
ZenScript CopyMutableDataComponentHolder.setComponent<T : Object>(componentType as DataComponentType<T>, value as @org.openzen.zencode.java.ZenCodeType.Nullable T) as @org.openzen.zencode.java.ZenCodeType.Nullable T
Parameter | Type |
---|---|
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 CopyMutableDataComponentHolder.update<T : Object>(componentType as DataComponentType<T>, value as T, updater as UnaryOperator<T>) as @org.openzen.zencode.java.ZenCodeType.Nullable T
Parameter | Type |
---|---|
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 CopyMutableDataComponentHolder.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
Parameter | Type |
---|---|
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 |