ContainerSingleItem

Link to containersingleitem

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.world.ContainerSingleItem;

Implemented Interfaces

Link to implemented-interfaces

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

Name: getTheItem

Gets the only item held by the container.

Returns: The item held by the container.
Return Type: ItemStack

ZenScript
Copy
// ContainerSingleItem.getTheItem() as ItemStack

myContainerSingleItem.getTheItem();

Name: setTheItem

Sets the only item held by the container.

ZenScript
Copy
ContainerSingleItem.setTheItem(stack as ItemStack)
ParameterTypeDescription
Parameter
stack
Type
ItemStack
Description
The new item for te container to hold.

Name: splitTheItem

Removes up to the specified amount of the contained item.

Returns: The item that was split from the contained item.
Return Type: ItemStack

ZenScript
Copy
ContainerSingleItem.splitTheItem(amount as int) as ItemStack
ParameterTypeDescription
Parameter
amount
Type
int
Description
The maximum amount of the item to split off from the contained item.