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 Copyimport 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
Methods
Link to methods
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 CopyContainerSingleItem.setTheItem(stack as ItemStack)
Parameter | Type | Description |
---|---|---|
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 CopyContainerSingleItem.splitTheItem(amount as int) as ItemStack
Parameter | Type | Description |
---|---|---|
Parameter amount | Type int | Description The maximum amount of the item to split off from the contained item. |