A reference to an item and count owned by some external entity.
is_blueprint_setup() → boolean | Is this blueprint item setup? |
get_blueprint_entities() → array[BlueprintEntity] | The 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. |
transfer_stack(stack) → boolean | Transfers the given item stack into this item stack. |
export_stack() → string | Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string |
import_stack(data) → int | Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string |
swap_stack(stack) → boolean | Swaps this item stack with the given item stack if allowed. |
clear() | Clear this item stack. |
get_blueprint_tiles() → array[Tile] | A list of the tiles in this blueprint. |
set_blueprint_tiles(tiles) | Set specific tiles in this blueprint. |
get_inventory(inventory) → LuaInventory | Access the inner inventory of an item. |
build_blueprint{surface = …, force = …, position = …, force_build = …, direction = …, skip_fog_of_war = …, by_player = …, raise_built = …} → array[LuaEntity] | Build this blueprint |
deconstruct_area{surface = …, force = …, area = …, skip_fog_of_war = …, by_player = …} | Deconstruct the given area with this deconstruction item. |
cancel_deconstruct_area{surface = …, force = …, area = …, skip_fog_of_war = …, by_player = …} | Cancel deconstruct the given area with this deconstruction item. |
create_blueprint{surface = …, force = …, area = …, always_include_tiles = …, include_entities = …, include_modules = …, include_station_names = …, include_trains = …, include_fuel = …} → dictionary[uint → LuaEntity] | Sets up this blueprint using the found blueprintable entities/tiles on the surface. |
get_tag(tag_name) → AnyBasic | Gets the tag with the given name or returns nil if it doesn't exist. |
set_tag(tag_name, tag) → AnyBasic | Sets the tag with the given name and value. |
remove_tag(tag) → boolean | Removes a tag with the given name. |
clear_blueprint() | Clears this blueprint item. |
get_entity_filter(index) → string | Gets the entity filter at the given index for this deconstruction item. |
set_entity_filter(index, filter) → boolean | Sets the entity filter at the given index for this deconstruction item. |
get_tile_filter(index) → string | Gets the tile filter at the given index for this deconstruction item. |
set_tile_filter(index, filter) → boolean | Sets the tile filter at the given index for this deconstruction item. |
clear_deconstruction_item() | Clears all settings/filters on this deconstruction item resetting it to default values. |
clear_upgrade_item() | Clears all settings/filters on this upgrade item resetting it to default values. |
get_mapper(index, type) → UpgradeFilter | Gets the filter at the given index for this upgrade item. |
set_mapper(index, type, filter) | Sets the module filter at the given index for this upgrade item. |
get_blueprint_entity_count() → uint | Gets the number of entities in this blueprint item. |
get_blueprint_entity_tags(index) → Tags | Gets the tags for the given blueprint entity index in this blueprint item. |
set_blueprint_entity_tags(index, tags) | Sets the tags on the given blueprint entity index in this blueprint item. |
get_blueprint_entity_tag(index, tag) → AnyBasic | Gets the given tag on the given blueprint entity index in this blueprint item. |
set_blueprint_entity_tag(index, tag, value) | Sets the given tag on the given blueprint entity index in this blueprint item. |
create_grid() → LuaEquipmentGrid | Creates the equipment grid for this item if it doesn't exist and this is an item-with-entity-data that supports equipment grids. |
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[BlueprintSignalIcon] [RW] | Icons of a blueprint item, blueprint book, deconstruction item or upgrade planner. |
blueprint_snap_to_grid :: Position [RW] | The snapping grid size in this blueprint item or nil if snapping is not enabled. |
blueprint_position_relative_to_grid :: Position [RW] | The offset from the absolute grid or nil if absolute snapping is not enabled. |
blueprint_absolute_snapping :: boolean [RW] | If absolute snapping is enabled on this 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[BlueprintItemIcon] [R] | The default icons for a blueprint item. |
tags :: Tags [RW] | |
custom_description :: LocalisedString [RW] | The custom description this item-with-tags. |
entity_filters :: array[string] [RW] | The entity filters for this deconstruction item. |
tile_filters :: array[string] [RW] | The tile filters for this deconstruction item. |
entity_filter_mode :: defines.deconstruction_item.entity_filter_mode [RW] | The blacklist/whitelist entity filter mode for this deconstruction item. |
tile_filter_mode :: defines.deconstruction_item.tile_filter_mode [RW] | The blacklist/whitelist tile filter mode for this deconstruction item. |
tile_selection_mode :: defines.deconstruction_item.tile_selection_mode [RW] | The tile selection mode for this deconstruction item. |
trees_and_rocks_only :: boolean [RW] | If this deconstruction item is set to allow trees and rocks only. |
entity_filter_count :: uint [R] | The number of entity filters this deconstruction item supports. |
tile_filter_count :: uint [R] | The number of tile filters this deconstruction item supports. |
active_index :: uint [RW] | The active blueprint index for this blueprint book. |
item_number :: uint [R] | The unique identifier for this item if it has one, nil otherwise. |
connected_entity :: LuaEntity [RW] | If this item is a spidertron remote that has a spidertron bound to it, it returns the
connected spider-vehicle entity, nil otherwise. |
is_blueprint :: boolean [R] | If this is a blueprint item. |
is_blueprint_book :: boolean [R] | If this is a blueprint book item. |
is_module :: boolean [R] | If this is a module item. |
is_tool :: boolean [R] | If this is a tool item. |
is_mining_tool :: boolean [R] | If this is a mining tool item. |
is_armor :: boolean [R] | If this is an armor item. |
is_repair_tool :: boolean [R] | If this is a repair tool item. |
is_item_with_label :: boolean [R] | If this is an item with label item. |
is_item_with_inventory :: boolean [R] | If this is an item with inventory item. |
is_item_with_entity_data :: boolean [R] | If this is an item with entity data item. |
is_selection_tool :: boolean [R] | If this is a selection tool item. |
is_item_with_tags :: boolean [R] | If this is an item with tags item. |
is_deconstruction_item :: boolean [R] | If this is a deconstruction tool item. |
is_upgrade_item :: boolean [R] | If this is a upgrade item. |
valid :: boolean [R] | Is this object valid? |
object_name :: string [R] | The class name of this object. |
help() → string | All methods and properties that this object supports. |
Is this blueprint item setup? I.e. is it a non-empty blueprint?
The 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.Transfers the given item stack into this item stack.
Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string
Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string
Swaps this item stack with the given item stack if allowed.
Clear this item stack.
A list of the tiles in this blueprint.
Set specific tiles in this blueprint.
Access the inner inventory of an item.
nil
if there is no inventory with the given index.Build this blueprint
Deconstruct the given area with this deconstruction item.
Cancel deconstruct the given area with this deconstruction item.
Sets up this blueprint using the found blueprintable entities/tiles on the surface.
Gets the tag with the given name or returns nil
if it doesn't exist.
Removes a tag with the given name.
Clears this blueprint item.
Gets the entity filter at the given index for this deconstruction item.
Sets the entity filter at the given index for this deconstruction item.
Gets the tile filter at the given index for this deconstruction item.
Sets the tile filter at the given index for this deconstruction item.
Clears all settings/filters on this deconstruction item resetting it to default values.
Clears all settings/filters on this upgrade item resetting it to default values.
Sets the module filter at the given index for this upgrade item.
Gets the number of entities in this blueprint item.
Gets the tags for the given blueprint entity index in this blueprint item.
Creates the equipment grid for this item if it doesn't exist and this is an item-with-entity-data that supports equipment grids.
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, blueprint book, deconstruction item or upgrade planner. An item that doesn't have icons returns nil on read and throws error on write.
The snapping grid size in this blueprint item or nil if snapping is not enabled.
The offset from the absolute grid or nil if absolute snapping is not enabled.
If absolute snapping is enabled on this blueprint item.
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.
The default icons for a blueprint item.
The custom description this item-with-tags. This is shown over the normal item description if this is set to a non-empty value.
The entity filters for this deconstruction item. The attribute is a sparse array with the keys representing the index of
the filter. All strings in this array must be entity prototype names that don't have the "not-deconstructable"
flag
set and are either a cliff
or marked as minable
.
The tile filters for this deconstruction item. The attribute is a sparse array with the keys representing the index of the filter. All strings in this array must be tile prototype names.
The blacklist/whitelist entity filter mode for this deconstruction item.
The blacklist/whitelist tile filter mode for this deconstruction item.
The tile selection mode for this deconstruction item.
If this deconstruction item is set to allow trees and rocks only.
The number of entity filters this deconstruction item supports.
The number of tile filters this deconstruction item supports.
The active blueprint index for this blueprint book. May be nil
.
The unique identifier for this item if it has one, nil
otherwise. Note that this ID stays the same no matter where the item is moved to.
"armor"
"spidertron-remote"
"selection-tool"
"copy-paste-tool"
"upgrade-item"
"deconstruction-item"
"blueprint"
"blueprint-book"
"item-with-entity-data"
"item-with-inventory"
"item-with-tags"
If this item is a spidertron remote that has a spidertron bound to it, it returns the
connected spider-vehicle entity, nil
otherwise.
If this is a blueprint item.
If this is a blueprint book item.
If this is a module item.
If this is a tool item.
If this is a mining tool item.
If this is an armor item.
If this is a repair tool item.
If this is an item with label item.
If this is an item with inventory item.
If this is an item with entity data item.
If this is a selection tool item.
If this is an item with tags item.
If this is a deconstruction tool item.
If this is a upgrade item.