Inventory
endstone.inventory
¶
Classes:
Name | Description |
---|---|
Inventory |
Interface to the various inventories. |
ItemStack |
Represents a stack of items. |
PlayerInventory |
Interface to the inventory of a Player, including the four armor slots and any extra slots. |
Inventory
¶
Interface to the various inventories.
Methods:
Name | Description |
---|---|
add_item |
Stores the given ItemStacks in the inventory. This will try to fill existing stacks and empty slots as well as it can. |
clear |
Clears out the whole Inventory. |
first |
Returns the first slot in the inventory containing an ItemStack with the given stack. |
get_item |
Returns the ItemStack found in the slot at the given index |
set_item |
Stores the ItemStack at the given index of the inventory. |
Attributes:
Name | Type | Description |
---|---|---|
contents |
list[ItemStack]
|
Returns all ItemStacks from the inventory |
is_empty |
bool
|
Check whether this inventory is empty. An inventory is considered to be empty if there are no ItemStacks in any slot of this inventory. |
max_stack_size |
int
|
Returns the maximum stack size for an ItemStack in this inventory. |
size |
int
|
Returns the size of the inventory |
is_empty
property
¶
is_empty: bool
Check whether this inventory is empty. An inventory is considered to be empty if there are no ItemStacks in any slot of this inventory.
max_stack_size
property
¶
max_stack_size: int
Returns the maximum stack size for an ItemStack in this inventory.
add_item
¶
add_item(item: ItemStack) -> None
Stores the given ItemStacks in the inventory. This will try to fill existing stacks and empty slots as well as it can.
first
¶
Returns the first slot in the inventory containing an ItemStack with the given stack.
get_item
¶
Returns the ItemStack found in the slot at the given index