get_output_inventory() | → LuaInventory? | Gets the entity's output inventory if it has one. |
Gets the entity's output inventory if it has one. | ||
get_module_inventory() | → LuaInventory? | Inventory for storing modules of this entity; |
Inventory for storing modules of this entity; | ||
get_fuel_inventory() | → LuaInventory? | The fuel inventory for this entity or |
The fuel inventory for this entity or | ||
get_burnt_result_inventory() | → LuaInventory? | The burnt result inventory for this entity or |
The burnt result inventory for this entity or | ||
damage(damage, force, type?, source?, cause?) changed | → float | Damages the entity. |
Damages the entity. | ||
can_be_destroyed() | → boolean | Whether the entity can be destroyed |
Whether the entity can be destroyed | ||
destroy{do_cliff_correction?=…, raise_destroy?=…, player?=…, item_index?=…} changed | → boolean | Destroys the entity. [...] |
Destroys the entity. [...] | ||
die(force?, cause?) changed | → boolean | Immediately kills the entity. [...] |
Immediately kills the entity. [...] | ||
has_flag(flag) | → boolean | Test whether this entity's prototype has a certain flag set. [...] |
Test whether this entity's prototype has a certain flag set. [...] | ||
ghost_has_flag(flag) | → boolean | Same as LuaEntity::has_flag, but targets the inner entity on a entity ghost. |
Same as LuaEntity::has_flag, but targets the inner entity on a entity ghost. | ||
add_market_item(offer) | Offer a thing on the market. | |
Offer a thing on the market. | ||
remove_market_item(offer) | → boolean | Remove an offer from a market. [...] |
Remove an offer from a market. [...] | ||
get_market_items() | → array[Offer] | Get all offers in a market as an array. |
Get all offers in a market as an array. | ||
clear_market_items() | Removes all offers from a market. | |
Removes all offers from a market. | ||
order_deconstruction(force, player?, item_index?) changed | → boolean | Sets the entity to be deconstructed by construction robots. |
Sets the entity to be deconstructed by construction robots. | ||
cancel_deconstruction(force, player?) changed | Cancels deconstruction if it is scheduled, does nothing otherwise. | |
Cancels deconstruction if it is scheduled, does nothing otherwise. | ||
to_be_deconstructed() | → boolean | Is this entity marked for deconstruction? |
Is this entity marked for deconstruction? | ||
order_upgrade{target=…, force=…, player?=…, item_index?=…} changed | → boolean | Sets the entity to be upgraded by construction robots. |
Sets the entity to be upgraded by construction robots. | ||
cancel_upgrade(force, player?) changed | → boolean | Cancels upgrade if it is scheduled, does nothing otherwise. |
Cancels upgrade if it is scheduled, does nothing otherwise. | ||
to_be_upgraded() | → boolean | Is this entity marked for upgrade? |
Is this entity marked for upgrade? | ||
is_crafting() | → boolean | Returns whether a craft is currently in process. [...] |
Returns whether a craft is currently in process. [...] | ||
is_opened() | → boolean | |
is_opening() | → boolean | |
is_closed() | → boolean | |
is_closing() | → boolean | |
request_to_open(force, extra_time?) changed | ||
request_to_close(force) changed | ||
get_transport_line(index) | → LuaTransportLine | Get a transport line of a belt or belt connectable entity. |
Get a transport line of a belt or belt connectable entity. | ||
get_item_insert_specification(position) new | → uint, float | Get an item insert specification onto a belt connectable: for a given map position provides into which line at what position item should be inserted to be closest to the provided position. |
Get an item insert specification onto a belt connectable: for a given map position provides into which line at what position item should be inserted to be closest to the provided position. | ||
get_line_item_position(index, position) new | → MapPosition | Get a map position related to a position on a transport line. |
Get a map position related to a position on a transport line. | ||
get_max_transport_line_index() | → uint | Get the maximum transport line index of a belt or belt connectable entity. |
Get the maximum transport line index of a belt or belt connectable entity. | ||
launch_rocket() | → boolean | |
revive{return_item_request_proxy?=…, raise_revive?=…} | → dictionary[string → uint]?, LuaEntity?, LuaEntity? | Revive a ghost, which turns it from a ghost into a real entity or tile. |
Revive a ghost, which turns it from a ghost into a real entity or tile. | ||
silent_revive{raise_revive?=…} changed | → array[ItemWithQualityCounts], LuaEntity?, LuaEntity? | Revives a ghost silently, so the revival makes no sound and no smoke is created. |
Revives a ghost silently, so the revival makes no sound and no smoke is created. | ||
get_connected_rail{rail_direction=…, rail_connection_direction=…} | → LuaEntity?, defines.rail_direction?, defines.rail_connection_direction? | |
get_connected_rails() | → array[LuaEntity] | Get the rails that this signal is connected to. |
Get the rails that this signal is connected to. | ||
get_rail_segment_signal(direction, in_else_out) new | → LuaEntity? | Get the rail signal at the start/end of the rail segment this rail is in. [...] |
Get the rail signal at the start/end of the rail segment this rail is in. [...] | ||
get_rail_segment_stop(direction) new | → LuaEntity? | Get train stop at the start/end of the rail segment this rail is in. [...] |
Get train stop at the start/end of the rail segment this rail is in. [...] | ||
get_rail_segment_end(direction) | → LuaEntity, defines.rail_direction | Get the rail at the end of the rail segment this rail is in. [...] |
Get the rail at the end of the rail segment this rail is in. [...] | ||
get_rail_segment_rails(direction) | → array[LuaEntity] | Get all rails of a rail segment this rail is in A rail segment is a continuous section of rail with no branches, signals, nor train stops. |
Get all rails of a rail segment this rail is in A rail segment is a continuous section of rail with no branches, signals, nor train stops. | ||
get_rail_segment_length() | → double | Get the length of the rail segment this rail is in. [...] |
Get the length of the rail segment this rail is in. [...] | ||
get_rail_segment_overlaps() | → array[LuaEntity] | Get a rail from each rail segment that overlaps with this rail's rail segment. [...] |
Get a rail from each rail segment that overlaps with this rail's rail segment. [...] | ||
is_rail_in_same_rail_segment_as(other_rail) | → boolean | Checks if this rail and other rail both belong to the same rail segment. |
Checks if this rail and other rail both belong to the same rail segment. | ||
is_rail_in_same_rail_block_as(other_rail) | → boolean | Checks if this rail and other rail both belong to the same rail block. |
Checks if this rail and other rail both belong to the same rail block. | ||
get_parent_signals() | → array[LuaEntity] | Returns all parent signals. [...] |
Returns all parent signals. [...] | ||
get_child_signals() | → array[LuaEntity] | Returns all child signals. [...] |
Returns all child signals. [...] | ||
get_inbound_signals() | → array[LuaEntity] | Returns all signals guarding entrance to a rail block this rail belongs to. |
Returns all signals guarding entrance to a rail block this rail belongs to. | ||
get_outbound_signals() | → array[LuaEntity] | Returns all signals guarding exit from a rail block this rail belongs to. |
Returns all signals guarding exit from a rail block this rail belongs to. | ||
get_filter(slot_index) changed | → ItemFilter? | Get the filter for a slot in an inserter, loader, or logistic storage container. [...] |
Get the filter for a slot in an inserter, loader, or logistic storage container. [...] | ||
set_filter(index, filter?) changed | Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID) or logistic storage container (ItemWithQualityID). [...] | |
Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID) or logistic storage container (ItemWithQualityID). [...] | ||
get_infinity_container_filter(index) | → InfinityInventoryFilter? | Gets the filter for this infinity container at the given index, or |
Gets the filter for this infinity container at the given index, or | ||
set_infinity_container_filter(index, filter) | Sets the filter for this infinity container at the given index. | |
Sets the filter for this infinity container at the given index. | ||
get_infinity_pipe_filter() | → InfinityPipeFilter? | Gets the filter for this infinity pipe, or |
Gets the filter for this infinity pipe, or | ||
set_infinity_pipe_filter(filter) | Sets the filter for this infinity pipe. | |
Sets the filter for this infinity pipe. | ||
get_heat_setting() | → HeatSetting | Gets the heat setting for this heat interface. |
Gets the heat setting for this heat interface. | ||
set_heat_setting(filter) | Sets the heat setting for this heat interface. | |
Sets the heat setting for this heat interface. | ||
get_control_behavior() | → LuaControlBehavior? | Gets the control behavior of the entity (if any). |
Gets the control behavior of the entity (if any). | ||
get_or_create_control_behavior() | → LuaControlBehavior? | Gets (and or creates if needed) the control behavior of the entity. |
Gets (and or creates if needed) the control behavior of the entity. | ||
get_circuit_network(wire_connector_id) changed | → LuaCircuitNetwork? | |
get_signal(signal, wire_connector_id, extra_wire_connector_id?) new | → int | Read a single signal from the selected wire connector |
Read a single signal from the selected wire connector | ||
get_signals(wire_connector_id, extra_wire_connector_id?) new | → array[Signal]? | Read all signals from the selected wire connector. |
Read all signals from the selected wire connector. | ||
supports_backer_name() | → boolean | Whether this entity supports a backer name. |
Whether this entity supports a backer name. | ||
copy_settings(entity, by_player?) changed | → array[ItemWithQualityCounts] | Copies settings from the given entity onto this entity. |
Copies settings from the given entity onto this entity. | ||
get_logistic_point(index?) | → LuaLogisticPoint or dictionary[defines.logistic_member_index → LuaLogisticPoint]? | Gets all the |
Gets all the | ||
play_note(instrument, note) | → boolean | Plays a note with the given instrument and note. |
Plays a note with the given instrument and note. | ||
connect_rolling_stock(direction) | → boolean | Connects the rolling stock in the given direction. |
Connects the rolling stock in the given direction. | ||
disconnect_rolling_stock(direction) | → boolean | Tries to disconnect this rolling stock in the given direction. |
Tries to disconnect this rolling stock in the given direction. | ||
update_connections() | Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script. [...] | |
Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script. [...] | ||
get_recipe() changed | → LuaRecipe?, LuaQualityPrototype? | Current recipe being assembled by this machine, if any. |
Current recipe being assembled by this machine, if any. | ||
set_recipe(recipe?, quality?) changed | → array[ItemWithQualityCounts] | Sets the given recipe in this assembly machine. |
Sets the given recipe in this assembly machine. | ||
rotate{reverse?=…, by_player?=…} changed | → boolean | Rotates this entity as if the player rotated it. |
Rotates this entity as if the player rotated it. | ||
get_driver() | → LuaEntity or LuaPlayer? | Gets the driver of this vehicle if any. |
Gets the driver of this vehicle if any. | ||
set_driver(driver?) | Sets the driver of this vehicle. [...] | |
Sets the driver of this vehicle. [...] | ||
get_passenger() | → LuaEntity or LuaPlayer? | Gets the passenger of this car or spidertron if any. [...] |
Gets the passenger of this car or spidertron if any. [...] | ||
set_passenger(passenger?) | Sets the passenger of this car or spidertron. [...] | |
Sets the passenger of this car or spidertron. [...] | ||
is_connected_to_electric_network() | → boolean | Returns |
Returns | ||
get_train_stop_trains() | → array[LuaTrain] | The trains scheduled to stop at this train stop. |
The trains scheduled to stop at this train stop. | ||
get_stopped_train() | → LuaTrain? | The train currently stopped at this train stop, if any. |
The train currently stopped at this train stop, if any. | ||
clone{position=…, surface?=…, force?=…, create_build_effect_smoke?=…} changed | → LuaEntity? | Clones this entity. |
Clones this entity. | ||
get_fluid_count(fluid?) | → double | Get the amount of all or some fluid in this entity. [...] |
Get the amount of all or some fluid in this entity. [...] | ||
get_fluid_contents() | → dictionary[string → double] | Get amounts of all fluids in this entity. [...] |
Get amounts of all fluids in this entity. [...] | ||
remove_fluid{name=…, amount=…, minimum_temperature?=…, maximum_temperature?=…, temperature?=…} | → double | Remove fluid from this entity. [...] |
Remove fluid from this entity. [...] | ||
insert_fluid(fluid) | → double | Insert fluid into this entity. [...] |
Insert fluid into this entity. [...] | ||
clear_fluid_inside() | Remove all fluids from this entity. | |
Remove all fluids from this entity. | ||
get_beam_source() | → BeamTarget? | Get the source of this beam. |
Get the source of this beam. | ||
set_beam_source(source) | Set the source of this beam. | |
Set the source of this beam. | ||
get_beam_target() | → BeamTarget? | Get the target of this beam. |
Get the target of this beam. | ||
set_beam_target(target) | Set the target of this beam. | |
Set the target of this beam. | ||
get_radius() | → double | The radius of this entity. |
The radius of this entity. | ||
get_health_ratio() | → float? | The health ratio of this entity between 1 and 0 (for full health and no health respectively). |
The health ratio of this entity between 1 and 0 (for full health and no health respectively). | ||
create_build_effect_smoke() | Creates the same smoke that is created when you place a building by hand. [...] | |
Creates the same smoke that is created when you place a building by hand. [...] | ||
release_from_spawner() | Release the unit from the spawner which spawned it. [...] | |
Release the unit from the spawner which spawned it. [...] | ||
toggle_equipment_movement_bonus() | Toggle this entity's equipment movement bonus. [...] | |
Toggle this entity's equipment movement bonus. [...] | ||
can_shoot(target, position) | → boolean | Whether this character can shoot the given entity or position. |
Whether this character can shoot the given entity or position. | ||
start_fading_out() | Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. [...] | |
Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. [...] | ||
get_upgrade_target() changed | → LuaEntityPrototype?, LuaQualityPrototype? | Returns the new entity prototype and its quality. |
Returns the new entity prototype and its quality. | ||
get_damage_to_be_taken() | → float? | Returns the amount of damage to be taken by this entity. |
Returns the amount of damage to be taken by this entity. | ||
deplete() | Depletes and destroys this resource entity. | |
Depletes and destroys this resource entity. | ||
mine{inventory?=…, force?=…, raise_destroyed?=…, ignore_minable?=…} | → boolean | Mines this entity. [...] |
Mines this entity. [...] | ||
spawn_decorations() | Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner". | |
Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner". | ||
get_priority_target(index) new | → LuaEntityPrototype? | Get the entity ID at the specified position in the turret's priority list. |
Get the entity ID at the specified position in the turret's priority list. | ||
set_priority_target(index, entity_id?) new | Set the entity ID name at the specified position in the turret's priority list. | |
Set the entity ID name at the specified position in the turret's priority list. | ||
can_wires_reach(entity) | → boolean | Can wires reach between these entities. |
Can wires reach between these entities. | ||
get_connected_rolling_stock(direction) | → LuaEntity?, defines.rail_direction? | Gets rolling stock connected to the given end of this stock. |
Gets rolling stock connected to the given end of this stock. | ||
is_registered_for_construction() | → boolean | Is this entity or tile ghost or item request proxy registered for construction? [...] |
Is this entity or tile ghost or item request proxy registered for construction? [...] | ||
is_registered_for_deconstruction(force) changed | → boolean | Is this entity registered for deconstruction with this force? [...] |
Is this entity registered for deconstruction with this force? [...] | ||
is_registered_for_upgrade() | → boolean | Is this entity registered for upgrade? [...] |
Is this entity registered for upgrade? [...] | ||
is_registered_for_repair() | → boolean | Is this entity registered for repair? [...] |
Is this entity registered for repair? [...] | ||
add_autopilot_destination(position) | Adds the given position to this spidertron's autopilot's queue of destinations. | |
Adds the given position to this spidertron's autopilot's queue of destinations. | ||
connect_linked_belts(neighbour?) | Connects current linked belt with another one. [...] | |
Connects current linked belt with another one. [...] | ||
disconnect_linked_belts() | Disconnects linked belt from its neighbour. [...] | |
Disconnects linked belt from its neighbour. [...] | ||
get_spider_legs() | → array[LuaEntity] | Gets legs of given SpiderVehicle. |
Gets legs of given SpiderVehicle. | ||
stop_spider() | Sets the speed of the given SpiderVehicle to zero. [...] | |
Sets the speed of the given SpiderVehicle to zero. [...] | ||
get_wire_connector(wire_connector_id, or_create) new | → LuaWireConnector | Gets a single wire connector of this entity |
Gets a single wire connector of this entity | ||
get_wire_connectors(or_create) new | → dictionary[defines.wire_connector_id → LuaWireConnector] | Gets all wire connectors of this entity |
Gets all wire connectors of this entity | ||
get_rail_end(direction) new | → LuaRailEnd | Gets a LuaRailEnd object for specified end of this rail |
Gets a LuaRailEnd object for specified end of this rail | ||
get_electric_input_flow_limit(quality?) new | → double? | The input flow limit for the electric energy source. [...] |
The input flow limit for the electric energy source. [...] | ||
get_electric_output_flow_limit(quality?) new | → double? | The output flow limit for the electric energy source. [...] |
The output flow limit for the electric energy source. [...] | ||
get_beacons() | → array[LuaEntity]? | Returns a table with all beacons affecting this effect receiver. [...] |
Returns a table with all beacons affecting this effect receiver. [...] | ||
get_beacon_effect_receivers() | → array[LuaEntity] | Returns a table with all entities affected by this beacon |
Returns a table with all entities affected by this beacon | ||
force_finish_ascending() new | Take an ascending cargo pod and safely make it skip all animation and immediately switch surface. | |
Take an ascending cargo pod and safely make it skip all animation and immediately switch surface. | ||
force_finish_descending() new | Take a descending cargo pod and safely make it arrive and deposit cargo. | |
Take a descending cargo pod and safely make it arrive and deposit cargo. | ||
get_fluid(index) new | → Fluid? | Gets fluid of the i-th fluid storage. |
Gets fluid of the i-th fluid storage. | ||
set_fluid(index, fluid?) new | → Fluid? | Sets fluid to the i-th fluid storage. [...] |
Sets fluid to the i-th fluid storage. [...] | ||
get_logistic_sections() new | → LuaLogisticSections? | Gives logistic sections of this entity if it uses logistic sections. |
Gives logistic sections of this entity if it uses logistic sections. | ||
name | :: R string | Name of the entity prototype. [...] |
Name of the entity prototype. [...] | ||
ghost_name | :: R string | Name of the entity or tile contained in this ghost |
Name of the entity or tile contained in this ghost | ||
localised_name | :: R LocalisedString | Localised name of the entity. |
Localised name of the entity. | ||
localised_description | :: R LocalisedString | |
ghost_localised_name | :: R LocalisedString | Localised name of the entity or tile contained in this ghost. |
Localised name of the entity or tile contained in this ghost. | ||
ghost_localised_description | :: R LocalisedString | |
type | :: R string | The entity prototype type of this entity. |
The entity prototype type of this entity. | ||
ghost_type | :: R string | The prototype type of the entity or tile contained in this ghost. |
The prototype type of the entity or tile contained in this ghost. | ||
use_filters new | :: RW boolean | If set to 'true', this inserter will use filtering logic. [...] |
If set to 'true', this inserter will use filtering logic. [...] | ||
active | :: RW boolean | Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc). [...] |
Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc). [...] | ||
destructible | :: RW boolean | If set to |
If set to | ||
minable | :: RW boolean | Not minable entities can still be destroyed. [...] |
Not minable entities can still be destroyed. [...] | ||
minable_flag new | :: RW boolean | Script controlled flag that allows entity to be mined. |
Script controlled flag that allows entity to be mined. | ||
rotatable | :: RW boolean | When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key. [...] |
When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key. [...] | ||
operable | :: RW boolean | Player can't open gui of this entity and he can't quick insert/input stuff in to the entity when it is not operable. |
Player can't open gui of this entity and he can't quick insert/input stuff in to the entity when it is not operable. | ||
health | :: RW float? | The current health of the entity, if any. [...] |
The current health of the entity, if any. [...] | ||
max_health new | :: R float | Max health of this entity. |
Max health of this entity. | ||
direction | :: RW defines.direction | The current direction this entity is facing. |
The current direction this entity is facing. | ||
mirroring new | :: RW boolean | If the entity is currently mirrored. [...] |
If the entity is currently mirrored. [...] | ||
supports_direction | :: R boolean | Whether the entity has direction. [...] |
Whether the entity has direction. [...] | ||
orientation | :: RW RealOrientation | The smooth orientation of this entity. |
The smooth orientation of this entity. | ||
cliff_orientation | :: R CliffOrientation | The orientation of this cliff. |
The orientation of this cliff. | ||
relative_turret_orientation | :: RW RealOrientation? | The relative orientation of the vehicle turret, artillery turret, artillery wagon. [...] |
The relative orientation of the vehicle turret, artillery turret, artillery wagon. [...] | ||
torso_orientation | :: RW RealOrientation | The torso orientation of this spider vehicle. |
The torso orientation of this spider vehicle. | ||
amount | :: RW uint | Count of resource units contained. |
Count of resource units contained. | ||
initial_amount | :: RW uint? | Count of initial resource units contained. [...] |
Count of initial resource units contained. [...] | ||
effectivity_modifier | :: RW float | Multiplies the acceleration the vehicle can create for one unit of energy. [...] |
Multiplies the acceleration the vehicle can create for one unit of energy. [...] | ||
consumption_modifier | :: RW float | Multiplies the energy consumption. |
Multiplies the energy consumption. | ||
friction_modifier | :: RW float | Multiplies the car friction rate. |
Multiplies the car friction rate. | ||
driver_is_gunner | :: RW boolean? | Whether the driver of this car or spidertron is the gunner. [...] |
Whether the driver of this car or spidertron is the gunner. [...] | ||
vehicle_automatic_targeting_parameters | :: RW VehicleAutomaticTargetingParameters | Read when this spidertron auto-targets enemies |
Read when this spidertron auto-targets enemies | ||
speed | :: RW float? | The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a unit. [...] |
The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a unit. [...] | ||
effective_speed | :: R float? | The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on. [...] |
The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on. [...] | ||
stack | :: R LuaItemStack | |
prototype | :: R LuaEntityPrototype | The entity prototype of this entity. |
The entity prototype of this entity. | ||
ghost_prototype | :: R LuaEntityPrototype or LuaTilePrototype | The prototype of the entity or tile contained in this ghost. |
The prototype of the entity or tile contained in this ghost. | ||
drop_position | :: RW MapPosition | Position where the entity puts its stuff. [...] |
Position where the entity puts its stuff. [...] | ||
pickup_position | :: RW MapPosition | Where the inserter will pick up items from. [...] |
Where the inserter will pick up items from. [...] | ||
drop_target | :: RW LuaEntity? | The entity this entity is putting its items to. [...] |
The entity this entity is putting its items to. [...] | ||
pickup_target | :: RW LuaEntity? | The entity this inserter will attempt to pick up items from. [...] |
The entity this inserter will attempt to pick up items from. [...] | ||
selected_gun_index | :: RW uint? | Index of the currently selected weapon slot of this character, car, or spidertron. [...] |
Index of the currently selected weapon slot of this character, car, or spidertron. [...] | ||
energy | :: RW double | Energy stored in the entity's energy buffer (energy stored in electrical devices etc.). [...] |
Energy stored in the entity's energy buffer (energy stored in electrical devices etc.). [...] | ||
temperature | :: RW double? | The temperature of this entity's heat energy source. [...] |
The temperature of this entity's heat energy source. [...] | ||
previous_recipe changed | :: R RecipeIDAndQualityIDPair? | The previous recipe this furnace was using, if any. |
The previous recipe this furnace was using, if any. | ||
held_stack | :: R LuaItemStack | The item stack currently held in an inserter's hand. |
The item stack currently held in an inserter's hand. | ||
held_stack_position | :: R MapPosition | Current position of the inserter's "hand". |
Current position of the inserter's "hand". | ||
train | :: R LuaTrain? | The train this rolling stock belongs to, if any. [...] |
The train this rolling stock belongs to, if any. [...] | ||
neighbours | :: R dictionary[string → array[LuaEntity]] or array[array[LuaEntity]] or LuaEntity? | A list of neighbours for certain types of entities. [...] |
A list of neighbours for certain types of entities. [...] | ||
belt_neighbours | :: R table | The belt connectable neighbours of this belt connectable entity. [...] |
The belt connectable neighbours of this belt connectable entity. [...] | ||
fluidbox changed | :: R LuaFluidBox | Fluidboxes of this entity. |
Fluidboxes of this entity. | ||
backer_name | :: RW string? | The backer name assigned to this entity. [...] |
The backer name assigned to this entity. [...] | ||
entity_label | :: RW string? | The label on this spider-vehicle entity, if any. [...] |
The label on this spider-vehicle entity, if any. [...] | ||
time_to_live changed | :: RW uint64 | The ticks left before a combat robot, highlight box, smoke, or sticker entity is destroyed. |
The ticks left before a combat robot, highlight box, smoke, or sticker entity is destroyed. | ||
color | :: RW Color? | The color of this character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner. [...] |
The color of this character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner. [...] | ||
signal_state | :: R defines.signal_state | The state of this rail signal. |
The state of this rail signal. | ||
chain_signal_state | :: R defines.chain_signal_state | The state of this chain signal. |
The state of this chain signal. | ||
to_be_looted | :: RW boolean | Will this item entity be picked up automatically when the player walks over it? |
Will this item entity be picked up automatically when the player walks over it? | ||
crafting_speed | :: R double | The current crafting speed, including speed bonuses from modules and beacons. |
The current crafting speed, including speed bonuses from modules and beacons. | ||
crafting_progress | :: RW float | The current crafting progress, as a number in range |
The current crafting progress, as a number in range | ||
bonus_progress | :: RW double | The current productivity bonus progress, as a number in range |
The current productivity bonus progress, as a number in range | ||
result_quality new | :: R LuaQualityPrototype | W QualityID? | The quality produced when this crafting machine finishes crafting. [...] |
The quality produced when this crafting machine finishes crafting. [...] | ||
productivity_bonus | :: R double | The productivity bonus of this entity. [...] |
The productivity bonus of this entity. [...] | ||
pollution_bonus | :: R double | The pollution bonus of this entity. |
The pollution bonus of this entity. | ||
speed_bonus | :: R double | The speed bonus of this entity. [...] |
The speed bonus of this entity. [...] | ||
consumption_bonus | :: R double | The consumption bonus of this entity. |
The consumption bonus of this entity. | ||
belt_to_ground_type | :: R "input" or "output" | Whether this underground belt goes into or out of the ground. |
Whether this underground belt goes into or out of the ground. | ||
loader_type | :: RW "input" or "output" | Whether this loader gets items from or puts item into a container. |
Whether this loader gets items from or puts item into a container. | ||
rocket_parts | :: RW uint | Number of rocket parts in the silo. |
Number of rocket parts in the silo. | ||
logistic_network | :: RW LuaLogisticNetwork | The logistic network this entity is a part of, or |
The logistic network this entity is a part of, or | ||
logistic_cell | :: R LuaLogisticCell | The logistic cell this entity is a part of. [...] |
The logistic cell this entity is a part of. [...] | ||
item_requests changed | :: R array[ItemWithQualityCounts] | Items this ghost will request when revived or items this item request proxy is requesting. |
Items this ghost will request when revived or items this item request proxy is requesting. | ||
insert_plan new | :: RW array[BlueprintInsertPlan] | The insert plan for this ghost or item request proxy. |
The insert plan for this ghost or item request proxy. | ||
removal_plan new | :: RW array[BlueprintInsertPlan] | The removal plan for this item request proxy. |
The removal plan for this item request proxy. | ||
player | :: R LuaPlayer? | The player connected to this character, if any. |
The player connected to this character, if any. | ||
damage_dealt | :: RW double | The damage dealt by this turret, artillery turret, or artillery wagon. |
The damage dealt by this turret, artillery turret, or artillery wagon. | ||
kills | :: RW uint | The number of units killed by this turret, artillery turret, or artillery wagon. |
The number of units killed by this turret, artillery turret, or artillery wagon. | ||
ignore_unprioritised_targets new | :: RW boolean | Whether this turret shoots at targets that are not on its priority list. |
Whether this turret shoots at targets that are not on its priority list. | ||
last_user | :: RW LuaPlayer or PlayerIdentification? | The last player that changed any setting on this entity. [...] |
The last player that changed any setting on this entity. [...] | ||
electric_buffer_size | :: RW double? | The buffer size for the electric energy source. [...] |
The buffer size for the electric energy source. [...] | ||
electric_drain | :: R double? | The electric drain for the electric energy source. [...] |
The electric drain for the electric energy source. [...] | ||
electric_emissions_per_joule new | :: R dictionary[string → double] ? | The table of emissions of this energy source in |
The table of emissions of this energy source in | ||
unit_number | :: R uint? | A unique number identifying this entity for the lifetime of the save. [...] |
A unique number identifying this entity for the lifetime of the save. [...] | ||
ghost_unit_number | :: R uint? | The unit_number of the entity contained in this ghost. [...] |
The unit_number of the entity contained in this ghost. [...] | ||
mining_progress | :: RW double? | The mining progress for this mining drill. [...] |
The mining progress for this mining drill. [...] | ||
bonus_mining_progress | :: RW double? | The bonus mining progress for this mining drill. [...] |
The bonus mining progress for this mining drill. [...] | ||
power_production | :: RW double | The power production specific to the ElectricEnergyInterface entity type. |
The power production specific to the ElectricEnergyInterface entity type. | ||
power_usage | :: RW double | The power usage specific to the ElectricEnergyInterface entity type. |
The power usage specific to the ElectricEnergyInterface entity type. | ||
bounding_box | :: R BoundingBox | LuaEntityPrototype::collision_box around entity's given position and respecting the current entity orientation. |
LuaEntityPrototype::collision_box around entity's given position and respecting the current entity orientation. | ||
secondary_bounding_box | :: R BoundingBox? | The secondary bounding box of this entity or |
The secondary bounding box of this entity or | ||
selection_box | :: R BoundingBox | LuaEntityPrototype::selection_box around entity's given position and respecting the current entity orientation. |
LuaEntityPrototype::selection_box around entity's given position and respecting the current entity orientation. | ||
secondary_selection_box | :: R BoundingBox? | The secondary selection box of this entity or |
The secondary selection box of this entity or | ||
mining_target | :: R LuaEntity? | The mining target, if any. |
The mining target, if any. | ||
filter_slot_count | :: R uint | The number of filter slots this inserter, loader, mining drill or logistic storage container has. [...] |
The number of filter slots this inserter, loader, mining drill or logistic storage container has. [...] | ||
loader_container | :: R LuaEntity? | The container entity this loader is pointing at/pulling from depending on the LuaEntity::loader_type, if any. |
The container entity this loader is pointing at/pulling from depending on the LuaEntity::loader_type, if any. | ||
grid | :: R LuaEquipmentGrid? | This entity's equipment grid, if any. |
This entity's equipment grid, if any. | ||
graphics_variation | :: RW uint8? | The graphics variation for this entity. [...] |
The graphics variation for this entity. [...] | ||
tree_color_index | :: RW uint8 | Index of the tree color. |
Index of the tree color. | ||
tree_color_index_max | :: R uint8 | Maximum index of the tree colors. |
Maximum index of the tree colors. | ||
tree_stage_index | :: RW uint8 | Index of the tree stage. |
Index of the tree stage. | ||
tree_stage_index_max | :: R uint8 | Maximum index of the tree stages. |
Maximum index of the tree stages. | ||
tree_gray_stage_index | :: RW uint8 | Index of the tree gray stage |
Index of the tree gray stage | ||
tree_gray_stage_index_max | :: R uint8 | Maximum index of the tree gray stages. |
Maximum index of the tree gray stages. | ||
burner | :: R LuaBurner? | The burner energy source for this entity, if any. |
The burner energy source for this entity, if any. | ||
shooting_target | :: RW LuaEntity? | The shooting target for this turret, if any. [...] |
The shooting target for this turret, if any. [...] | ||
proxy_target | :: R LuaEntity? | The target entity for this item-request-proxy, if any. |
The target entity for this item-request-proxy, if any. | ||
stickers | :: R array[LuaEntity] ? | The sticker entities attached to this entity, if any. |
The sticker entities attached to this entity, if any. | ||
sticked_to | :: R LuaEntity | The entity this sticker is sticked to. |
The entity this sticker is sticked to. | ||
sticker_vehicle_modifiers changed | :: R table ? | The vehicle modifiers applied to this entity through the attached stickers. |
The vehicle modifiers applied to this entity through the attached stickers. | ||
parameters | :: RW ProgrammableSpeakerParameters | |
alert_parameters | :: RW ProgrammableSpeakerAlertParameters | |
electric_network_statistics | :: R LuaFlowStatistics | The electric network statistics for this electric pole. |
The electric network statistics for this electric pole. | ||
inserter_target_pickup_count | :: R uint | Returns the current target pickup count of the inserter. [...] |
Returns the current target pickup count of the inserter. [...] | ||
inserter_stack_size_override | :: RW uint | Sets the stack size limit on this inserter. [...] |
Sets the stack size limit on this inserter. [...] | ||
products_finished | :: RW uint | The number of products this machine finished crafting in its lifetime. |
The number of products this machine finished crafting in its lifetime. | ||
spawning_cooldown | :: R double | |
absorbed_pollution | :: R double | |
spawn_shift | :: R double | |
units | :: R array[LuaEntity] | The units associated with this spawner entity. |
The units associated with this spawner entity. | ||
power_switch_state | :: RW boolean | The state of this power switch. |
The state of this power switch. | ||
combinator_description new | :: RW string | The description on this combinator |
The description on this combinator | ||
effects | :: R ModuleEffects? | The effects being applied to this entity, if any. [...] |
The effects being applied to this entity, if any. [...] | ||
beacons_count | :: R uint? | Number of beacons affecting this effect receiver. [...] |
Number of beacons affecting this effect receiver. [...] | ||
infinity_container_filters | :: RW array[InfinityInventoryFilter] | The filters for this infinity container. |
The filters for this infinity container. | ||
remove_unfiltered_items | :: RW boolean | Whether items not included in this infinity container filters should be removed from the container. |
Whether items not included in this infinity container filters should be removed from the container. | ||
character_corpse_player_index | :: RW uint | The player index associated with this character corpse. [...] |
The player index associated with this character corpse. [...] | ||
character_corpse_tick_of_death | :: RW uint | The tick this character corpse died at. |
The tick this character corpse died at. | ||
character_corpse_death_cause | :: RW LocalisedString | The reason this character corpse character died. [...] |
The reason this character corpse character died. [...] | ||
associated_player | :: RW LuaPlayer or PlayerIdentification? | The player this character is associated with, if any. [...] |
The player this character is associated with, if any. [...] | ||
tick_of_last_attack | :: RW uint | The last tick this character entity was attacked. |
The last tick this character entity was attacked. | ||
tick_of_last_damage | :: RW uint | The last tick this character entity was damaged. |
The last tick this character entity was damaged. | ||
splitter_filter changed | :: RW ItemFilter? | The filter for this splitter, if any is set. |
The filter for this splitter, if any is set. | ||
inserter_filter_mode | :: RW "whitelist" or "blacklist" ? | The filter mode for this filter inserter. [...] |
The filter mode for this filter inserter. [...] | ||
loader_filter_mode new | :: RW "none" or "whitelist" or "blacklist" ? | The filter mode for this loader. [...] |
The filter mode for this loader. [...] | ||
mining_drill_filter_mode new | :: RW "whitelist" or "blacklist" ? | The filter mode for this mining drill. [...] |
The filter mode for this mining drill. [...] | ||
splitter_input_priority | :: RW "left" or "none" or "right" | The input priority for this splitter. |
The input priority for this splitter. | ||
splitter_output_priority | :: RW "left" or "none" or "right" | The output priority for this splitter. |
The output priority for this splitter. | ||
armed | :: R boolean | Whether this land mine is armed. |
Whether this land mine is armed. | ||
recipe_locked | :: RW boolean | When locked; the recipe in this assembling machine can't be changed by the player. |
When locked; the recipe in this assembling machine can't be changed by the player. | ||
connected_rail | :: R LuaEntity? | The rail entity this train stop is connected to, if any. |
The rail entity this train stop is connected to, if any. | ||
connected_rail_direction | :: R defines.rail_direction | Rail direction to which this train stop is binding. [...] |
Rail direction to which this train stop is binding. [...] | ||
trains_in_block | :: R uint | The number of trains in this rail block for this rail entity. |
The number of trains in this rail block for this rail entity. | ||
timeout | :: RW uint | The timeout that's left on this landmine in ticks. [...] |
The timeout that's left on this landmine in ticks. [...] | ||
neighbour_bonus | :: R double | The current total neighbour bonus of this reactor. |
The current total neighbour bonus of this reactor. | ||
ai_settings | :: R LuaAISettings | The ai settings of this unit. |
The ai settings of this unit. | ||
highlight_box_type | :: RW CursorBoxRenderType | The highlight box type of this highlight box entity. |
The highlight box type of this highlight box entity. | ||
highlight_box_blink_interval | :: RW uint | The blink interval of this highlight box entity. [...] |
The blink interval of this highlight box entity. [...] | ||
status | :: R defines.entity_status? | The status of this entity, if any. [...] |
The status of this entity, if any. [...] | ||
custom_status new | :: RW CustomEntityStatus? | A custom status for this entity that will be displayed in the GUI. |
A custom status for this entity that will be displayed in the GUI. | ||
enable_logistics_while_moving | :: RW boolean | Whether equipment grid logistics are enabled while this vehicle is moving. |
Whether equipment grid logistics are enabled while this vehicle is moving. | ||
render_player | :: RW LuaPlayer or PlayerIdentification? | The player that this |
The player that this | ||
render_to_forces changed | :: RW ForceSet? | The forces that this |
The forces that this | ||
pump_rail_target | :: R LuaEntity? | The rail target of this pump, if any. |
The rail target of this pump, if any. | ||
electric_network_id | :: R uint? | Returns the id of the electric network that this entity is connected to, if any. |
Returns the id of the electric network that this entity is connected to, if any. | ||
allow_dispatching_robots | :: RW boolean | Whether this character's personal roboports are allowed to dispatch robots. |
Whether this character's personal roboports are allowed to dispatch robots. | ||
energy_generated_last_tick | :: R double | How much energy this generator generated in the last tick. |
How much energy this generator generated in the last tick. | ||
storage_filter changed | :: R ItemIDAndQualityIDPair | W ItemWithQualityID? | The storage filter for this logistic storage container. [...] |
The storage filter for this logistic storage container. [...] | ||
request_from_buffers | :: RW boolean | Whether this requester chest is set to also request from buffer chests. [...] |
Whether this requester chest is set to also request from buffer chests. [...] | ||
corpse_expires | :: RW boolean | Whether this corpse will ever fade away. |
Whether this corpse will ever fade away. | ||
corpse_immune_to_entity_placement | :: RW boolean | If true, corpse won't be destroyed when entities are placed over it. [...] |
If true, corpse won't be destroyed when entities are placed over it. [...] | ||
tags | :: RW Tags? | The tags associated with this entity ghost. [...] |
The tags associated with this entity ghost. [...] | ||
time_to_next_effect | :: RW uint | The ticks until the next trigger effect of this smoke-with-trigger. |
The ticks until the next trigger effect of this smoke-with-trigger. | ||
autopilot_destination | :: RW MapPosition? | Destination of this spidertron's autopilot, if any. [...] |
Destination of this spidertron's autopilot, if any. [...] | ||
autopilot_destinations | :: R array[MapPosition] | The queued destination positions of spidertron's autopilot. |
The queued destination positions of spidertron's autopilot. | ||
trains_count | :: R uint | Amount of trains related to this particular train stop. [...] |
Amount of trains related to this particular train stop. [...] | ||
trains_limit | :: RW uint | Amount of trains above which no new trains will be sent to this train stop. [...] |
Amount of trains above which no new trains will be sent to this train stop. [...] | ||
is_military_target | :: RW boolean | Whether this entity is a MilitaryTarget. [...] |
Whether this entity is a MilitaryTarget. [...] | ||
is_entity_with_owner | :: R boolean | If this entity is EntityWithOwner |
If this entity is EntityWithOwner | ||
is_entity_with_health | :: R boolean | If this entity is EntityWithHealth |
If this entity is EntityWithHealth | ||
combat_robot_owner | :: RW LuaEntity? | The owner of this combat robot, if any. |
The owner of this combat robot, if any. | ||
link_id | :: RW uint | The link ID this linked container is using. |
The link ID this linked container is using. | ||
follow_target | :: RW LuaEntity? | The follow target of this spidertron, if any. |
The follow target of this spidertron, if any. | ||
follow_offset | :: RW Vector? | The follow offset of this spidertron, if any entity is being followed. [...] |
The follow offset of this spidertron, if any entity is being followed. [...] | ||
linked_belt_type | :: RW "input" or "output" | Type of linked belt. [...] |
Type of linked belt. [...] | ||
linked_belt_neighbour | :: R LuaEntity? | Neighbour to which this linked belt is connected to, if any. [...] |
Neighbour to which this linked belt is connected to, if any. [...] | ||
quality new | :: R LuaQualityPrototype | The quality of this entity. [...] |
The quality of this entity. [...] | ||
rail_layer new | :: R defines.rail_layer | Gets rail layer of a given signal |
Gets rail layer of a given signal | ||
radar_scan_progress | :: R float | The current radar scan progress, as a number in range |
The current radar scan progress, as a number in range | ||
name_tag new | :: RW string | Name tag of this entity. [...] |
Name tag of this entity. [...] | ||
rocket_silo_status | :: R defines.rocket_silo_status | The status of this rocket silo entity. |
The status of this rocket silo entity. | ||
tile_width | :: R uint | Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...] |
Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...] | ||
tile_height | :: R uint | Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...] |
Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension). [...] | ||
crane_destination new | :: RW MapPosition | Destination of the crane of this entity. [...] |
Destination of the crane of this entity. [...] | ||
crane_destination_3d new | :: RW Vector3D | Destination of the crane of this entity in 3D. [...] |
Destination of the crane of this entity in 3D. [...] | ||
crane_grappler_destination new | :: W MapPosition | Will set destination for the grappler of crane of this entity. [...] |
Will set destination for the grappler of crane of this entity. [...] | ||
crane_grappler_destination_3d new | :: W Vector3D | Will set destination in 3D for the grappler of crane of this entity. [...] |
Will set destination in 3D for the grappler of crane of this entity. [...] | ||
copy_color_from_train_stop new | :: RW boolean | If this RollingStock has 'copy color from train stop' enabled. |
If this RollingStock has 'copy color from train stop' enabled. | ||
is_headed_to_trains_front | :: R boolean | If the rolling stock is facing train's front. |
If the rolling stock is facing train's front. | ||
draw_data | :: R RollingStockDrawData | Gives a draw data of the given entity if it supports such data. |
Gives a draw data of the given entity if it supports such data. | ||
train_stop_priority new | :: RW uint8 | Priority of this train stop. |
Priority of this train stop. | ||
belt_shape | :: R "straight" or "left" or "right" | Gives what is the current shape of a transport-belt. [...] |
Gives what is the current shape of a transport-belt. [...] | ||
gps_tag | :: R string | Returns a rich text string containing this entity's position and surface name as a gps tag. [...] |
Returns a rich text string containing this entity's position and surface name as a gps tag. [...] | ||
commandable new | :: R LuaCommandable? | Returns a LuaCommandable for this entity or nil if entity is not commandable. |
Returns a LuaCommandable for this entity or nil if entity is not commandable. | ||
fluids_count new | :: R uint | Returns count of fluid storages. [...] |
Returns count of fluid storages. [...] | ||
tick_grown new | :: RW MapTick | The tick when this plant is fully grown. |
The tick when this plant is fully grown. | ||
always_on new | :: RW boolean | If the lamp is always on when not driven by control behavior. |
If the lamp is always on when not driven by control behavior. | ||
artillery_auto_targeting new | :: RW boolean | If this artillery auto-targets enemies. |
If this artillery auto-targets enemies. | ||
robot_order_queue new | :: R array[WorkerRobotOrder] | Get the current queue of robot orders. |
Get the current queue of robot orders. | ||
cargo_pod new | :: R LuaEntity? | Gets the cargo pod attached to this rocket silo rocket if one exists. |
Gets the cargo pod attached to this rocket silo rocket if one exists. | ||
procession_tick new | :: RW MapTick | how far into the current procession the cargo pod is. |
how far into the current procession the cargo pod is. | ||
is_updatable new | :: R boolean | If the entity is updatable. |
If the entity is updatable. | ||
disabled_by_script new | :: RW boolean | If the updatable entity is disabled by script. [...] |
If the updatable entity is disabled by script. [...] | ||
disabled_by_control_behavior new | :: R boolean | If the updatable entity is disabled by control behavior. |
If the updatable entity is disabled by control behavior. | ||
disabled_by_recipe new | :: R boolean | If the updatable entity is disabled by recipe. |
If the updatable entity is disabled by recipe. | ||
is_freezable new | :: R boolean | If the entity is freezable. |
If the entity is freezable. | ||
frozen new | :: R boolean | If the freezable entity is currently frozen. |
If the freezable entity is currently frozen. | ||
valid | :: R boolean | Is this object valid? [...] |
Is this object valid? [...] | ||
object_name | :: R string | The class name of this object. [...] |
The class name of this object. [...] |
get_inventory(inventory) | → LuaInventory? | Get an inventory belonging to this entity. [...] |
Get an inventory belonging to this entity. [...] | ||
get_max_inventory_index() | → defines.inventory | The highest index of all inventories this entity can use. [...] |
The highest index of all inventories this entity can use. [...] | ||
get_main_inventory() | → LuaInventory? | Gets the main inventory for this character or player if this is a character or player. |
Gets the main inventory for this character or player if this is a character or player. | ||
can_insert(items) | → boolean | Can at least some items be inserted? |
Can at least some items be inserted? | ||
insert(items) | → uint | Insert items into this entity. [...] |
Insert items into this entity. [...] | ||
set_gui_arrow{margin=…, type=…} | Create an arrow which points at this entity. [...] | |
Create an arrow which points at this entity. [...] | ||
clear_gui_arrow() | Removes the arrow created by | |
Removes the arrow created by | ||
get_item_count(item?) changed | → uint | Get the number of all or some items in this entity. |
Get the number of all or some items in this entity. | ||
has_items_inside() | → boolean | Does this entity have any item inside it? |
Does this entity have any item inside it? | ||
can_reach_entity(entity) | → boolean | Can a given entity be opened or accessed? |
Can a given entity be opened or accessed? | ||
clear_items_inside() | Remove all items from this entity. | |
Remove all items from this entity. | ||
remove_item(items) | → uint | Remove items from this entity. |
Remove items from this entity. | ||
teleport(position, surface?, raise_teleported?, snap_to_grid?, build_check_type?) changed | → boolean | Teleport the entity to a given position, possibly on another surface. [...] |
Teleport the entity to a given position, possibly on another surface. [...] | ||
update_selected_entity(position) | Select an entity, as if by hovering the mouse above it. | |
Select an entity, as if by hovering the mouse above it. | ||
clear_selected_entity() | Unselect any selected entity. | |
Unselect any selected entity. | ||
disable_flashlight() | Disable the flashlight. | |
Disable the flashlight. | ||
enable_flashlight() | Enable the flashlight. | |
Enable the flashlight. | ||
is_flashlight_enabled() | → boolean | Is the flashlight enabled. |
Is the flashlight enabled. | ||
get_craftable_count(recipe) changed | → uint | Gets the count of the given recipe that can be crafted. |
Gets the count of the given recipe that can be crafted. | ||
begin_crafting{count=…, recipe=…, silent?=…} changed | → uint | Begins crafting the given count of the given recipe. |
Begins crafting the given count of the given recipe. | ||
cancel_crafting{index=…, count=…} | Cancels crafting the given count of the given crafting queue index. | |
Cancels crafting the given count of the given crafting queue index. | ||
mine_entity(entity, force?) | → boolean | Mines the given entity as if this player (or character) mined it. |
Mines the given entity as if this player (or character) mined it. | ||
mine_tile(tile) | → boolean | Mines the given tile as if this player (or character) mined it. |
Mines the given tile as if this player (or character) mined it. | ||
is_player() | → boolean | When |
When | ||
open_technology_gui(technology?) changed | Open the technology GUI and select a given technology. | |
Open the technology GUI and select a given technology. | ||
is_cursor_blueprint() | → boolean | Returns whether the player is holding a blueprint. [...] |
Returns whether the player is holding a blueprint. [...] | ||
is_cursor_empty() | → boolean | Returns whether the player is holding something in the cursor. [...] |
Returns whether the player is holding something in the cursor. [...] | ||
get_requester_point() new | → LuaLogisticPoint? | Gets the requester logistic point for this entity if it has one. |
Gets the requester logistic point for this entity if it has one. | ||
set_driving(driving, force?) new | Sets if this character or player is driving. [...] | |
Sets if this character or player is driving. [...] | ||
surface | :: R LuaSurface | The surface this entity is currently on. |
The surface this entity is currently on. | ||
surface_index | :: R uint | Unique index (ID) associated with the surface this entity is currently on. |
Unique index (ID) associated with the surface this entity is currently on. | ||
position | :: R MapPosition | The current position of the entity. |
The current position of the entity. | ||
vehicle | :: R LuaEntity? | The vehicle the player is currently sitting in. |
The vehicle the player is currently sitting in. | ||
force changed | :: R LuaForce | W ForceID | The force of this entity. [...] |
The force of this entity. [...] | ||
force_index | :: R uint | Unique index (ID) associated with the force of this entity. |
Unique index (ID) associated with the force of this entity. | ||
selected | :: RW LuaEntity? | The currently selected entity. [...] |
The currently selected entity. [...] | ||
opened changed | :: RW LuaEntity or LuaItemStack or LuaEquipment or LuaEquipmentGrid or LuaPlayer or LuaGuiElement or LuaInventory or LuaLogisticNetwork or defines.gui_type? | The GUI the player currently has open. [...] |
The GUI the player currently has open. [...] | ||
crafting_queue_size | :: R uint | Size of the crafting queue. |
Size of the crafting queue. | ||
crafting_queue_progress | :: RW double | The crafting queue progress in the range |
The crafting queue progress in the range | ||
walking_state | :: RW table | Current walking state. |
Current walking state. | ||
riding_state | :: RW RidingState | Current riding state of this car, or of the car this player is riding in. |
Current riding state of this car, or of the car this player is riding in. | ||
mining_state | :: RW table | Current mining state. [...] |
Current mining state. [...] | ||
shooting_state | :: RW table | Current shooting state. |
Current shooting state. | ||
picking_state | :: RW boolean | Current item-picking state. |
Current item-picking state. | ||
repair_state | :: RW table | Current repair state. |
Current repair state. | ||
cursor_stack | :: R LuaItemStack? | The player's cursor stack. [...] |
The player's cursor stack. [...] | ||
cursor_ghost changed | :: R ItemIDAndQualityIDPair | W ItemWithQualityID? | The ghost prototype in the player's cursor. [...] |
The ghost prototype in the player's cursor. [...] | ||
cursor_record new | :: R LuaRecord? | The blueprint record in the player's cursor. |
The blueprint record in the player's cursor. | ||
driving | :: RW boolean |
|
| ||
crafting_queue | :: R array[CraftingQueueItem] | The current crafting queue items. |
The current crafting queue items. | ||
following_robots | :: R array[LuaEntity] | The current combat robots following the character. [...] |
The current combat robots following the character. [...] | ||
cheat_mode | :: RW boolean | When |
When | ||
character_crafting_speed_modifier | :: RW double | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_mining_speed_modifier | :: RW double | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_additional_mining_categories | :: RW array[string] | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_running_speed_modifier | :: RW double | Modifies the running speed of this character by the given value as a percentage. [...] |
Modifies the running speed of this character by the given value as a percentage. [...] | ||
character_build_distance_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_item_drop_distance_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_reach_distance_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_resource_reach_distance_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_item_pickup_distance_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_loot_pickup_distance_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_inventory_slots_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_trash_slot_count_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_maximum_following_robot_count_bonus | :: RW uint | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
character_health_bonus | :: RW float | When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). |
When called on a LuaPlayer, it must be associated with a character (see LuaPlayer::character). | ||
opened_gui_type | :: R defines.gui_type? | |
build_distance | :: R uint | The build distance of this character or max uint when not a character or player connected to a character. |
The build distance of this character or max uint when not a character or player connected to a character. | ||
drop_item_distance | :: R uint | The item drop distance of this character or max uint when not a character or player connected to a character. |
The item drop distance of this character or max uint when not a character or player connected to a character. | ||
reach_distance | :: R uint | The reach distance of this character or max uint when not a character or player connected to a character. |
The reach distance of this character or max uint when not a character or player connected to a character. | ||
item_pickup_distance | :: R double | The item pickup distance of this character or max double when not a character or player connected to a character. |
The item pickup distance of this character or max double when not a character or player connected to a character. | ||
loot_pickup_distance | :: R double | The loot pickup distance of this character or max double when not a character or player connected to a character. |
The loot pickup distance of this character or max double when not a character or player connected to a character. | ||
resource_reach_distance | :: R double | The resource reach distance of this character or max double when not a character or player connected to a character. |
The resource reach distance of this character or max double when not a character or player connected to a character. | ||
in_combat | :: R boolean | Whether this character entity is in combat. |
Whether this character entity is in combat. | ||
character_running_speed | :: R double | The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting. |
The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting. | ||
character_mining_progress | :: R double | The current mining progress between 0 and 1 of this character, or 0 if they aren't mining. |
The current mining progress between 0 and 1 of this character, or 0 if they aren't mining. |
damage | :: float | The amount of damage to be done. |
The amount of damage to be done. | ||
force | :: ForceID | The force that will be doing the damage. |
The force that will be doing the damage. | ||
type | :: DamageTypeID? | The type of damage to be done, defaults to |
The type of damage to be done, defaults to | ||
source | :: LuaEntity? | The entity that is directly dealing the damage (e.g. the projectile, flame, sticker, grenade, laser beam, etc.). Needs to be on the same surface as the entity being damaged. |
The entity that is directly dealing the damage (e.g. the projectile, flame, sticker, grenade, laser beam, etc.). Needs to be on the same surface as the entity being damaged. | ||
cause | :: LuaEntity? | The entity that originally triggered the events that led to this damage being dealt (e.g. the character, turret, enemy, etc. that pulled the trigger). Does not need to be on the same surface as the entity being damaged. |
The entity that originally triggered the events that led to this damage being dealt (e.g. the character, turret, enemy, etc. that pulled the trigger). Does not need to be on the same surface as the entity being damaged. |
→ float | the total damage actually applied after resistances. |
on_entity_damaged instantly |
do_cliff_correction | :: boolean? | Whether neighbouring cliffs should be corrected. Defaults to |
Whether neighbouring cliffs should be corrected. Defaults to | ||
raise_destroy | :: boolean? | If |
If | ||
player | :: PlayerIdentification? | The player whose undo queue this action should be added to. |
The player whose undo queue this action should be added to. | ||
item_index | :: uint? | The index of the undo item to add this action to. An index of |
The index of the undo item to add this action to. An index of |
→ boolean | Returns |
script_raised_destroy? instantly | Raised if the |
force | :: ForceID? | The force to attribute the kill to. |
The force to attribute the kill to. | ||
cause | :: LuaEntity? | The cause to attribute the kill to. |
The cause to attribute the kill to. |
→ boolean | Whether the entity was successfully killed. |
on_entity_died? instantly | Raised if the entity was successfully killed. If |
on_post_entity_died? instantly | Raised if the entity was successfully killed. |
-- This function can be called with only the `cause` argument and no `force`:
entity.die(nil, killer_entity)
flag | :: EntityPrototypeFlag | The flag to test. |
The flag to test. |
→ boolean |
|
flag | :: EntityPrototypeFlag | The flag to test. |
The flag to test. |
→ boolean |
|
offer | :: Offer |
-- Adds market offer, 1 copper ore for 10 iron ore
market.add_market_item{price={{name = "iron-ore", count = 10}}, offer={type="give-item", item="copper-ore"}}
-- Adds market offer, 1 copper ore for 5 iron ore and 5 stone ore
market.add_market_item{price={{name = "iron-ore", count = 5}, {name = "stone", count = 5}}, offer={type="give-item", item="copper-ore"}}
force | :: ForceID | The force whose robots are supposed to do the deconstruction. |
The force whose robots are supposed to do the deconstruction. | ||
player | :: PlayerIdentification? | The player to set the last_user to, if any. Also the player whose undo queue this action should be added to. |
The player to set the last_user to, if any. Also the player whose undo queue this action should be added to. | ||
item_index | :: uint? | The index of the undo item to add this action to. An index of |
The index of the undo item to add this action to. An index of |
→ boolean | if the entity was marked for deconstruction. |
on_marked_for_deconstruction? instantly | Raised if the entity was successfully marked for deconstruction. |
force | :: ForceID | The force who did the deconstruction order. |
The force who did the deconstruction order. | ||
player | :: PlayerIdentification? | The player to set the |
The player to set the |
on_cancelled_deconstruction? instantly | Raised if the entity's deconstruction was successfully cancelled. |
target | :: EntityWithQualityID | The prototype of the entity to upgrade to. |
The prototype of the entity to upgrade to. | ||
force | :: ForceID | The force whose robots are supposed to do the upgrade. |
The force whose robots are supposed to do the upgrade. | ||
player | :: PlayerIdentification? | The player whose undo queue this action should be added to. |
The player whose undo queue this action should be added to. | ||
item_index | :: uint? | The index of the undo item to add this action to. An index of |
The index of the undo item to add this action to. An index of |
→ boolean | Whether the entity was marked for upgrade. |
on_marked_for_upgrade? instantly | Raised if the entity was successfully marked for upgrade. |
force | :: ForceID | The force who did the upgrade order. |
The force who did the upgrade order. | ||
player | :: PlayerIdentification? | The player to set the last_user to if any. |
The player to set the last_user to if any. |
→ boolean | Whether the cancel was successful. |
on_cancelled_upgrade? instantly | Raised if the entity way previously marked for upgrade. |
force | :: ForceID | The force that requests the gate to be closed. |
The force that requests the gate to be closed. |
index | :: uint | Index of the requested transport line. Transport lines are 1-indexed. |
Index of the requested transport line. Transport lines are 1-indexed. |
position | :: MapPosition | Position where the item is to be inserted. |
Position where the item is to be inserted. |
→ uint | Index of the transport line that is closest to the provided map position. |
→ float | Position along the transport line where item should be dropped. |
index | :: uint | Index of the transport line. Transport lines are 1-indexed. |
Index of the transport line. Transport lines are 1-indexed. | ||
position | :: float | Linear position along the transport line. Clamped to the transport line range. |
Linear position along the transport line. Clamped to the transport line range. |
→ boolean |
|
on_rocket_launch_ordered? instantly | Raised if the rocket launch was successfully initiated. |
return_item_request_proxy | :: boolean? | If |
If | ||
raise_revive | :: boolean? | If true, and an entity ghost; script_raised_revive will be called. Else if true, and a tile ghost; script_raised_set_tiles will be called. |
If true, and an entity ghost; script_raised_revive will be called. Else if true, and a tile ghost; script_raised_set_tiles will be called. |
→ dictionary[string → uint]? | Any items the new real entity collided with or |
→ LuaEntity? | The revived entity if an entity ghost was successfully revived. |
→ LuaEntity? | The item request proxy if it was requested with |
script_raised_revive? instantly | Raised if this was an entity ghost and the |
script_raised_set_tiles? instantly | Raised if this was a tile ghost and the |
raise_revive | :: boolean? | If true, and an entity ghost; script_raised_revive will be called. Else if true, and a tile ghost; script_raised_set_tiles will be called. |
If true, and an entity ghost; script_raised_revive will be called. Else if true, and a tile ghost; script_raised_set_tiles will be called. |
→ array[ItemWithQualityCounts] | Any items the new real entity collided with or |
→ LuaEntity? | The revived entity if an entity ghost was successfully revived. |
→ LuaEntity? | The item request proxy. |
script_raised_revive? instantly | Raised if this was an entity ghost and the |
script_raised_set_tiles? instantly | Raised if this was a tile ghost and the |
rail_direction | :: defines.rail_direction | |
rail_connection_direction | :: defines.rail_connection_direction |
→ LuaEntity? | Rail connected in the specified manner to this one, |
→ defines.rail_direction? | Rail direction of the returned rail which points to origin rail |
→ defines.rail_connection_direction? | Turn to be taken when going back from returned rail to origin rail |
direction | :: defines.rail_direction | The direction of travel relative to this rail. |
The direction of travel relative to this rail. | ||
in_else_out | :: boolean | If true, gets the signal at the entrance of the rail segment, otherwise gets the signal at the exit of the rail segment. |
If true, gets the signal at the entrance of the rail segment, otherwise gets the signal at the exit of the rail segment. |
→ LuaEntity? |
|
direction | :: defines.rail_direction | The direction of travel relative to this rail. |
The direction of travel relative to this rail. |
→ LuaEntity? |
|
direction | :: defines.rail_direction |
→ LuaEntity | The rail entity. |
→ defines.rail_direction | A rail direction pointing out of the rail segment from the end rail. |
direction | :: defines.rail_direction | Selects end of this rail that points to a rail segment end from which to start returning rails |
Selects end of this rail that points to a rail segment end from which to start returning rails |
→ array[LuaEntity] | Rails of this rail segment |
slot_index | :: uint | Index of the slot to get the filter for. |
Index of the slot to get the filter for. |
→ ItemFilter? | The filter, or |
index | :: uint | Index of the slot to set the filter for. |
Index of the slot to set the filter for. | ||
filter | :: ItemFilter or ItemWithQualityID or EntityID? | The item or entity to filter, or |
The item or entity to filter, or |
index | :: uint | The index to get. |
The index to get. |
index | :: uint | The index to set. |
The index to set. | ||
filter | :: InfinityInventoryFilter or nil | The new filter, or |
The new filter, or |
filter | :: InfinityPipeFilter or nil | The new filter, or |
The new filter, or |
filter | :: HeatSetting | The new setting. |
The new setting. |
wire_connector_id | :: defines.wire_connector_id | Wire connector to get circuit network for. |
Wire connector to get circuit network for. |
→ LuaCircuitNetwork? | The circuit network or nil. |
signal | :: SignalID | The signal to read. |
The signal to read. | ||
wire_connector_id | :: defines.wire_connector_id | Wire connector ID from which to get the signal |
Wire connector ID from which to get the signal | ||
extra_wire_connector_id | :: defines.wire_connector_id? | Additional wire connector ID. If specified, signal will be added to the result |
Additional wire connector ID. If specified, signal will be added to the result |
→ int | The current value of the signal. |
wire_connector_id | :: defines.wire_connector_id | Wire connector ID from which to get the signal |
Wire connector ID from which to get the signal | ||
extra_wire_connector_id | :: defines.wire_connector_id? | Additional wire connector ID. If specified, signals will be added to the result |
Additional wire connector ID. If specified, signals will be added to the result |
→ array[Signal]? | Current values of all signals. |
entity | :: LuaEntity | |
by_player | :: PlayerIdentification? | If provided, the copying is done 'as' this player and on_entity_settings_pasted is triggered. |
If provided, the copying is done 'as' this player and on_entity_settings_pasted is triggered. |
→ array[ItemWithQualityCounts] | Any items removed from this entity as a result of copying the settings. |
index | :: defines.logistic_member_index? | If provided, only returns the |
If provided, only returns the |
direction | :: defines.rail_direction |
→ boolean | Whether any connection was made |
direction | :: defines.rail_direction |
→ boolean | If anything was disconnected |
recipe | :: RecipeID? | The new recipe. Writing |
The new recipe. Writing | ||
quality | :: QualityID? | The quality. If not provided |
The quality. If not provided |
→ array[ItemWithQualityCounts] | Any items removed from this entity as a result of setting the recipe. |
reverse | :: boolean? | If |
If | ||
by_player | :: PlayerIdentification? |
→ boolean | Whether the rotation was successful. |
on_player_rotated_entity? instantly | Raised if the |
→ LuaEntity or LuaPlayer? |
|
driver | :: LuaEntity or PlayerIdentification? | The new driver. Writing |
The new driver. Writing |
on_player_driving_changed_state? instantly |
→ LuaEntity or LuaPlayer? |
|
passenger | :: LuaEntity or PlayerIdentification? | The new passenger. Writing |
The new passenger. Writing |
on_player_driving_changed_state? instantly |
position | :: MapPosition | The destination position |
The destination position | ||
surface | :: LuaSurface? | The destination surface |
The destination surface | ||
force | :: ForceID? | |
create_build_effect_smoke | :: boolean? | If false, the building effect smoke will not be shown around the new entity. |
If false, the building effect smoke will not be shown around the new entity. |
→ LuaEntity? | The cloned entity or |
on_entity_cloned? instantly | Raised if the entity was successfully cloned. |
fluid | :: string? | Prototype name of the fluid to count. If not specified, count all fluids. |
Prototype name of the fluid to count. If not specified, count all fluids. |
→ LuaEntityPrototype? |
|
→ LuaQualityPrototype? |
|
inventory | :: LuaInventory? | If provided the item(s) will be transferred into this inventory. If provided, this must be an inventory created with LuaGameScript::create_inventory or be a basic inventory owned by some entity. |
If provided the item(s) will be transferred into this inventory. If provided, this must be an inventory created with LuaGameScript::create_inventory or be a basic inventory owned by some entity. | ||
force | :: boolean? | If true, when the item(s) don't fit into the given inventory the entity is force mined. If false, the mining operation fails when there isn't enough room to transfer all of the items into the inventory. Defaults to false. This is ignored and acts as |
If true, when the item(s) don't fit into the given inventory the entity is force mined. If false, the mining operation fails when there isn't enough room to transfer all of the items into the inventory. Defaults to false. This is ignored and acts as | ||
raise_destroyed | :: boolean? | If true, script_raised_destroy will be raised. Defaults to |
If true, script_raised_destroy will be raised. Defaults to | ||
ignore_minable | :: boolean? | If true, the minable state of the entity is ignored. Defaults to |
If true, the minable state of the entity is ignored. Defaults to |
→ boolean | Whether mining succeeded. |
script_raised_destroy? instantly | Raised if the |
direction | :: defines.rail_direction |
→ LuaEntity? | The rolling stock connected at the given end, |
→ defines.rail_direction? | The rail direction of the connected rolling stock if any. |
force | :: ForceID | The force construction manager to check. |
The force construction manager to check. |
position | :: MapPosition | The position the spidertron should move to. |
The position the spidertron should move to. |
neighbour | :: LuaEntity? | Another linked belt or entity ghost containing linked belt to connect or nil to disconnect |
Another linked belt or entity ghost containing linked belt to connect or nil to disconnect |
wire_connector_id | :: defines.wire_connector_id | Identifier of a specific connector to get |
Identifier of a specific connector to get | ||
or_create | :: boolean | If true and connector does not exist, it will be allocated if possible |
If true and connector does not exist, it will be allocated if possible |
or_create | :: boolean | If true, it will try to create all connectors possible |
If true, it will try to create all connectors possible |
index | :: uint | Fluid storage index. Valid values are from 1 up to LuaEntity::fluids_count. |
Fluid storage index. Valid values are from 1 up to LuaEntity::fluids_count. |
→ Fluid? | Fluid in this storage. nil if fluid storage is empty. |
index | :: uint | Fluid storage index. Valid values are from 1 up to LuaEntity::fluids_count. |
Fluid storage index. Valid values are from 1 up to LuaEntity::fluids_count. | ||
fluid | :: Fluid? | Fluid to set. Fluid storage will be cleared if this is not provided. |
Fluid to set. Fluid storage will be cleared if this is not provided. |
→ Fluid? | Fluid in this storage after it was set. nil if fluid storage is empty. |
-- This will allow the car to go much faster
game.player.vehicle.friction_modifier = 0.5
game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
game.player.selected.energy = 3000
inputs | :: array[LuaEntity] | Array of transport belt connectable entities. |
Array of transport belt connectable entities. | ||
outputs | :: array[LuaEntity] | Array of transport belt connectable entities. |
Array of transport belt connectable entities. |
"none"
or "whitelist"
or "blacklist"
?new"whitelist"
or "blacklist"
?new"left"
or "none"
or "right"
"left"
or "none"
or "right"
-- called on a LuaEntity on the default surface it returns:
entity.gps_tag -- => "[gps=-4,-9]"
-- called on a LuaEntity on "custom-surface" it returns:
different_entity.gps_tag -- => "[gps=1,-5,custom-surface]"