BlockContainerSingleItem
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.world.BlockContainerSingleItem;
Implements
BlockContainerSingleItem
implements the following interfaces:
ContainerSingleItem
,Container
,Clearable
Members
Getter
// BlockContainerSingleItem.changedmyBlockContainerSingleItem.changed
changed()
// BlockContainerSingleItem.changed();myBlockContainerSingleItem.changed();
clearContent()
Clears the contents of this Clearable.script.zs
// BlockContainerSingleItem.clearContent();myBlockContainerSingleItem.clearContent();
Getter
Gets the size (how many slots) of this Containerscript.zs
// BlockContainerSingleItem.containerSize as intmyBlockContainerSingleItem.containerSize
Return Type:
int
containerSize() as int
Gets the size (how many slots) of this Containerscript.zs
Returns: The amount of slots this Container has.
// BlockContainerSingleItem.containerSize() as int;myBlockContainerSingleItem.containerSize();
Return Type:
int
countItem(item as Item) as int
myBlockContainerSingleItem.countItem(myItem);
Parameters:
item: ItemDefinition
Type: ItemDefinition
Return Type:
int
countStack(item as IItemStack) as int
myBlockContainerSingleItem.countStack(myIItemStack);
Parameters:
item: IItemStack
Type: IItemStack
Return Type:
int
getContainerBlockEntity() as BlockEntity
Gets the BlockEntity that holds the container.script.zs
Returns: The BlockEntity that holds the container.
myBlockContainerSingleItem.getContainerBlockEntity();
Return Type:
BlockEntity
getItem(index as int) as ItemStack
hasAnyOf(items as Set<Item>) as bool
myBlockContainerSingleItem.hasAnyOf(mySet);
Parameters:
items: Set<ItemDefinition>
Type: Set<ItemDefinition>
Return Type:
bool
Getter
Checks if this Container is empty.script.zs
// BlockContainerSingleItem.isEmpty as boolmyBlockContainerSingleItem.isEmpty
Return Type:
bool
isEmpty() as bool
Checks if this Container is empty.script.zs
Returns: True if empty. False otherwise.
// BlockContainerSingleItem.isEmpty() as bool;myBlockContainerSingleItem.isEmpty();
Return Type:
bool
Getter
// BlockContainerSingleItem.maxStackSize as intmyBlockContainerSingleItem.maxStackSize
Return Type:
int
maxStackSize() as int
// BlockContainerSingleItem.maxStackSize() as int;myBlockContainerSingleItem.maxStackSize();
Return Type:
int
splitTheItem(amount as int) as ItemStack
Removes up to the specified amount of the contained item.script.zs
Returns: The item that was split from the contained item.
myBlockContainerSingleItem.splitTheItem(myInt);
Parameters:
amount: int
Type: int
- The maximum amount of the item to split off from the contained item.
Return Type:
ItemStack
stillValid(player as Player) as bool
Checks if the player container is still valid for a player to interact with.script.zs
Returns: Whether the player can still access the container.
myBlockContainerSingleItem.stillValid(myPlayer);
Return Type:
bool