is_blueprint_setup() → boolean | Is this blueprint item setup? |
get_blueprint_entities() → array of blueprint entity | Entities in this blueprint. |
set_blueprint_entities(entities) | Set new entities to be a part of this blueprint. |
add_ammo(amount) | Add ammo to this ammo item. |
drain_ammo(amount) | Remove ammo from this ammo item. |
add_durability(amount) | Add durability to this tool item. |
drain_durability(amount) | Remove durability from this tool item. |
can_set_stack(stack) → boolean | Would a call to LuaItemStack::set_stack succeed? |
set_stack(stack) → boolean | Set this item stack to another item stack. |
clear() | Clear this item stack. |
get_blueprint_tiles() → array of blueprint tile | Tiles in this blueprint |
set_blueprint_tiles(tiles) | Set tiles in this blueprint |
get_inventory(inventory) → LuaInventory | Access the inner inventory of an item. |
build_blueprint{surface=…, force=…, position=…, force_build=…, direction=…} → array of LuaEntity | Build this blueprint |
create_blueprint{surface=…, force=…, area=…, always_include_tiles=…} | Sets up this blueprint using the found blueprintable entities/tiles on the surface. |
valid_for_read :: boolean [R] | Is this valid for reading? |
prototype :: LuaItemPrototype [R] | Prototype of the item held in this stack. |
name :: string [R] | Prototype name of the item held in this stack. |
type :: string [R] | Type of the item prototype. |
count :: uint [RW] | Number of items in this stack. |
grid :: LuaEquipmentGrid [R] | The equipment grid of this item or nil if this item doesn't have a grid. |
health :: float [RW] | How much health the item has, as a number in range [0, 1]. |
durability :: double [RW] | Durability of the contained item. |
ammo :: uint [RW] | Number of bullets left in the magazine. |
blueprint_icons :: array of Icon [RW] | Icons of a blueprint item. |
label :: string [RW] | The current label for this item. |
label_color :: Color [RW] | The current label color for this item. |
allow_manual_label_change :: boolean [RW] | If the label for this item can be manually changed. |
cost_to_build :: dictionary string → uint [R] | Raw materials required to build this blueprint. |
extends_inventory :: boolean [RW] | If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion). |
prioritize_insertion_mode :: string [RW] | The insertion mode priority this ItemWithInventory uses when items are inserted into an inventory it resides in. |
default_icons :: array of Icon [R] | The default icons for a blueprint item. |
valid :: boolean [R] | Is this object valid? |
An item and a count.
Is this blueprint item setup? I.e. is it a non-empty blueprint?
Entities in this blueprint.
Set new entities to be a part of this blueprint.
Add ammo to this ammo item.
Remove ammo from this ammo item.
Add durability to this tool item.
Remove durability from this tool item.
Set this item stack to another item stack.
nil
will clear this item stack, as
if by calling LuaItemStack::clear.Clear this item stack.
Set tiles in this blueprint
Access the inner inventory of an item.
nil
if there is no inventory with the given index.Build this blueprint
Sets up this blueprint using the found blueprintable entities/tiles on the surface.
Is this valid for reading? Differs from the usual valid
in that valid
will be true
even if
the item stack is blank but the entity that holds it is still valid.
Prototype of the item held in this stack.
Prototype name of the item held in this stack.
Type of the item prototype.
Number of items in this stack.
The equipment grid of this item or nil
if this item doesn't have a grid.
How much health the item has, as a number in range [0, 1].
Durability of the contained item. Automatically capped at the item's maximum durability.
nil
.
Number of bullets left in the magazine.
Icons of a blueprint item. Every entry of this array has the following fields:
The current label for this item. Nil when none.
The current label color for this item. Nil when none.
If the label for this item can be manually changed. When false the label can only be changed through the API.
Raw materials required to build this blueprint. Result is a dictionary mapping each item prototype name to the required count.
If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion). Only callable on items with inventories.
The insertion mode priority this ItemWithInventory uses when items are inserted into an inventory it resides in. Only callable on items with inventories.