inventory

class InventoryMixin(name: str, similar_entities: list[str], **kwargs: dict)

Enables the entity to have inventory control. Keeps track of the currently requested items for this entity and issues warnings if the requested items amount exceeds the inventory size of the entity.

set_item_request(item: str, count: int) None

Issues warnings if the set item exceeds the inventory size of the entity.

property bar: int

The limiting bar of the inventory. Used to prevent a the final-most slots in the inventory from accepting items.

Raises IndexWarning if the set value exceeds the Entity’s inventory_size attribute.

Getter:

Gets the bar location of the inventory.

Setter:

Sets the bar location of the inventory.

Type:

int

Raises:
  • DraftsmanError – If attempting to set the bar of an Entity that has the inventory_bar_enabled attribute set to False.

  • TypeError – If set to anything other than an int or None.

  • IndexError – If the set value lies outside of the range [0, 65536).

property inventory_bar_enabled: bool

Whether or not this Entity has its inventory limiting bar enabled. Equivalent to the "enable_inventory_bar" key in Factorio’s data.raw. Not exported; read only.

Type:

bool

property inventory_size: int

The number of inventory slots that this Entity has. Equivalent to the "inventory_size" key in Factorio’s data.raw. Not exported; read only.

Type:

int

property inventory_slots_occupied: int

The number of inventory slots filled by the item requests for this entity. Used to keep track of requested items and issue warnings if the amount inside the container exceeds the inventory size of the entity. Not exported; read only.