Container
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.Container;
Implements
Container
implements the following interfaces:
Members
Getter
// Container.changedmyContainer.changed
changed()
// Container.changed();myContainer.changed();
clearContent()
Clears the contents of this Clearable.script.zs
// Container.clearContent();myContainer.clearContent();
Getter
Gets the size (how many slots) of this Containerscript.zs
// Container.containerSize as intmyContainer.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.
// Container.containerSize() as int;myContainer.containerSize();
Return Type:
int
countItem(item as Item) as int
myContainer.countItem(myItem);
Parameters:
item: ItemDefinition
Type: ItemDefinition
Return Type:
int
countStack(item as IItemStack) as int
myContainer.countStack(myIItemStack);
Parameters:
item: IItemStack
Type: IItemStack
Return Type:
int
hasAnyOf(items as Set<Item>) as bool
myContainer.hasAnyOf(mySet);
Parameters:
items: Set<ItemDefinition>
Type: Set<ItemDefinition>
Return Type:
bool
Getter
Checks if this Container is empty.script.zs
// Container.isEmpty as boolmyContainer.isEmpty
Return Type:
bool
isEmpty() as bool
Checks if this Container is empty.script.zs
Returns: True if empty. False otherwise.
// Container.isEmpty() as bool;myContainer.isEmpty();
Return Type:
bool
Getter
// Container.maxStackSize as intmyContainer.maxStackSize
Return Type:
int
maxStackSize() as int
// Container.maxStackSize() as int;myContainer.maxStackSize();
Return Type:
int