MutableBundleContents

Link to mutablebundlecontents

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.item.component.MutableBundleContents;

Name: of

Return Type: MutableBundleContents

ZenScript
Copy
MutableBundleContents.of(contents as BundleContents) as MutableBundleContents
ParameterType
Parameter
contents
Type
BundleContents
Result TypeIs Implicit
Result Type
BundleContents
Is Implicit
true

Name: clearItems

Return Type: MutableBundleContents

ZenScript
Copy
// MutableBundleContents.clearItems() as MutableBundleContents

myMutableBundleContents.clearItems();

Name: removeOne

Return Type: IItemStack?

ZenScript
Copy
// MutableBundleContents.removeOne() as IItemStack?

myMutableBundleContents.removeOne();

Name: toImmutable

Return Type: BundleContents

ZenScript
Copy
// MutableBundleContents.toImmutable() as BundleContents

myMutableBundleContents.toImmutable();

Name: tryInsert

Return Type: int

ZenScript
Copy
MutableBundleContents.tryInsert(stack as ItemStack) as int
ParameterType
Parameter
stack
Type
ItemStack