Inventory
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.entity.type.player.Inventory;
Implements
Inventory
implements the following interfaces:
Operators
in(stack as ItemStack) as bool
in(tag as KnownTag<Item>) as bool
myKnownTag<Item> in myInventory
Parameters:
tag: KnownTag<ItemDefinition>
Type: KnownTag<ItemDefinition>
Return Type:
bool
Members
add(stack as ItemStack) as bool
add(index as int, stack as ItemStack) as bool
Getter
// Inventory.changedmyInventory.changed
changed()
// Inventory.changed();myInventory.changed();
clearContent()
Clears the contents of this Clearable.script.zs
// Inventory.clearContent();myInventory.clearContent();
Getter
Gets the size (how many slots) of this Containerscript.zs
// Inventory.containerSize as intmyInventory.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.
// Inventory.containerSize() as int;myInventory.containerSize();
Return Type:
int
contains(stack as ItemStack) as bool
contains(tag as KnownTag<Item>) as bool
myInventory.contains(myKnownTag);
Parameters:
tag: KnownTag<ItemDefinition>
Type: KnownTag<ItemDefinition>
Return Type:
bool
countItem(item as Item) as int
myInventory.countItem(myItem);
Parameters:
item: ItemDefinition
Type: ItemDefinition
Return Type:
int
countStack(item as IItemStack) as int
myInventory.countStack(myIItemStack);
Parameters:
item: IItemStack
Type: IItemStack
Return Type:
int
dropAll()
// Inventory.dropAll();myInventory.dropAll();
Getter
// Inventory.freeSlot as intmyInventory.freeSlot
Return Type:
int
freeSlot() as int
// Inventory.freeSlot() as int;myInventory.freeSlot();
Return Type:
int
hasAnyOf(items as Set<Item>) as bool
myInventory.hasAnyOf(mySet);
Parameters:
items: Set<ItemDefinition>
Type: Set<ItemDefinition>
Return Type:
bool
Getter
// Inventory.hasCustomName as boolmyInventory.hasCustomName
Return Type:
bool
hasCustomName() as bool
// Inventory.hasCustomName() as bool;myInventory.hasCustomName();
Return Type:
bool
Getter
Checks if this Container is empty.script.zs
// Inventory.isEmpty as boolmyInventory.isEmpty
Return Type:
bool
isEmpty() as bool
Checks if this Container is empty.script.zs
Returns: True if empty. False otherwise.
// Inventory.isEmpty() as bool;myInventory.isEmpty();
Return Type:
bool
Getter
// Inventory.maxStackSize as intmyInventory.maxStackSize
Return Type:
int
maxStackSize() as int
// Inventory.maxStackSize() as int;myInventory.maxStackSize();
Return Type:
int
pickSlot(index as int)
// Inventory.pickSlot(index as int);myInventory.pickSlot(myInt);
Parameters:
index: int
Type: int
removeItem(stack as ItemStack)
removeItem(var1 as int, var2 as int) as ItemStack
Getter
// Inventory.suitableHotbarSlot as intmyInventory.suitableHotbarSlot
Return Type:
int
suitableHotbarSlot() as int
// Inventory.suitableHotbarSlot() as int;myInventory.suitableHotbarSlot();
Return Type:
int
Getter
// Inventory.timesChanged as intmyInventory.timesChanged
Return Type:
int
timesChanged() as int
// Inventory.timesChanged() as int;myInventory.timesChanged();
Return Type:
int