Files
project-cybersyn/.vscode/factorio/runtime-api-LuaEntity.lua
2022-09-28 18:27:34 -05:00

2190 lines
109 KiB
Lua

---@meta
---@diagnostic disable
--$Factorio 1.1.69
--$Overlay 5
--$Section LuaEntity
-- This file is automatically generated. Edits will be overwritten.
---The primary interface for interacting with entities through the Lua API. Entities are everything that exists on the map except for tiles (see [LuaTile](https://lua-api.factorio.com/latest/LuaTile.html)).
---
---Most functions on LuaEntity also work when the entity is contained in a ghost.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html)
---@class LuaEntity:LuaControl
---[RW]
---Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc).
---
---**Note:** Entities that are not active naturally can't be set to be active (setting it to be active will do nothing)
---
---**Note:** Ghosts, simple smoke, and corpses can't be modified at this time.
---
---**Note:** It is even possible to set the character to not be active, so he can't move and perform most of the tasks.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.active)
---@field active boolean
---[R]
---The ai settings of this unit.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ai_settings)
---
---_Can only be used if this is Unit_
---@field ai_settings LuaAISettings
---[RW]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.alert_parameters)
---
---_Can only be used if this is ProgrammableSpeaker_
---@field alert_parameters ProgrammableSpeakerAlertParameters
---[RW]
---Whether this character's personal roboports are allowed to dispatch robots.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.allow_dispatching_robots)
---
---_Can only be used if this is Character_
---@field allow_dispatching_robots boolean
---[RW]
---Count of resource units contained.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.amount)
---
---_Can only be used if this is ResourceEntity_
---@field amount uint
---[R]
---Whether this land mine is armed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.armed)
---
---_Can only be used if this is LandMine_
---@field armed boolean
---[RW]
---The player this character is associated with, if any. Set to `nil` to clear.
---
---The player will be automatically disassociated when a controller is set on the character. Also, all characters associated to a player will be logged off when the player logs off in multiplayer.
---
---Reading this property will return a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), while [PlayerIdentification](https://lua-api.factorio.com/latest/Concepts.html#PlayerIdentification) can be used when writing.
---
---**Note:** A character associated with a player is not directly controlled by any player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.associated_player)
---
---_Can only be used if this is Character_
---@field associated_player? LuaPlayer|PlayerIdentification
---[RW]
---Whether this rocket silo automatically launches the rocket when cargo is inserted.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.auto_launch)
---
---_Can only be used if this is RocketSilo_
---@field auto_launch boolean
---[RW]
---Destination of this spidertron's autopilot, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destination)
---
---_Can only be used if this is SpiderVehicle_
---@field autopilot_destination? MapPosition
---[R]
---The queued destination positions of spidertron's autopilot.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destinations)
---
---_Can only be used if this is SpiderVehicle_
---@field autopilot_destinations MapPosition[]
---[RW]
---The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
---
---**Note:** While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.backer_name)
---@field backer_name? string
---[R]
---The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of this entity. Does not contain the other end of an underground belt, see [LuaEntity::neighbours](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbours) for that. This is a dictionary with `"inputs"`, `"outputs"` entries that are arrays of transport belt connectable entities, or empty tables if no entities.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.belt_neighbours)
---
---_Can only be used if this is TransportBeltConnectable_
---@field belt_neighbours {[string]: LuaEntity[]}
---[R]
---`"input"` or `"output"`, depending on whether this underground belt goes down or up.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.belt_to_ground_type)
---
---_Can only be used if this is TransportBeltToGround_
---@field belt_to_ground_type string
---[RW]
---The bonus mining progress for this mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time]. `nil` if this isn't a mining drill.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.bonus_mining_progress)
---@field bonus_mining_progress? double
---[RW]
---The current productivity bonus progress, as a number in range [0, 1].
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.bonus_progress)
---
---_Can only be used if this is CraftingMachine_
---@field bonus_progress double
---[R]
---[LuaEntityPrototype::collision_box](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_box) around entity's given position and respecting the current entity orientation.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.bounding_box)
---@field bounding_box BoundingBox
---[R]
---The burner energy source for this entity, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.burner)
---@field burner? LuaBurner
---[R]
---The state of this chain signal.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.chain_signal_state)
---
---_Can only be used if this is RailChainSignal_
---@field chain_signal_state defines.chain_signal_state
---[RW]
---The reason this character corpse character died. `""` if there is no reason.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.character_corpse_death_cause)
---
---_Can only be used if this is CharacterCorpse_
---@field character_corpse_death_cause LocalisedString
---[RW]
---The player index associated with this character corpse.
---
---**Note:** The index is not guaranteed to be valid so it should always be checked first if a player with that index actually exists.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.character_corpse_player_index)
---
---_Can only be used if this is CharacterCorpse_
---@field character_corpse_player_index uint
---[RW]
---The tick this character corpse died at.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.character_corpse_tick_of_death)
---
---_Can only be used if this is CharacterCorpse_
---@field character_corpse_tick_of_death uint
---[R]
---Entities that are directly connected to this entity via the circuit network. `nil` if this entity can't be connected to the circuit network.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connected_entities)
---@field circuit_connected_entities? LuaEntity.circuit_connected_entities
---[R]
---The connection definition for entities that are directly connected to this entity via the circuit network. `nil` if this entity can't be connected to the circuit network.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.circuit_connection_definitions)
---@field circuit_connection_definitions? CircuitConnectionDefinition[]
---[R]
---The orientation of this cliff.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.cliff_orientation)
---@field cliff_orientation CliffOrientation
---[RW]
---The color of this character, rolling stock, train stop, car, spider-vehicle, flying text, corpse or simple-entity-with-owner. `nil` if this entity doesn't use custom colors.
---
---**Note:** Car color is overridden by the color of the current driver/passenger, if there is one.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.color)
---@field color? Color
---[RW]
---The owner of this combat robot, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.combat_robot_owner)
---@field combat_robot_owner? LuaEntity
---[R]
---The command given to this unit, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.command)
---
---_Can only be used if this is Unit_
---@field command? Command
---[R]
---The rail entity this train stop is connected to, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connected_rail)
---
---_Can only be used if this is TrainStop_
---@field connected_rail? LuaEntity
---[R]
---Rail direction to which this train stop is binding. This returns a value even when no rails are present.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connected_rail_direction)
---
---_Can only be used if this is TrainStop_
---@field connected_rail_direction defines.rail_direction
---[R]
---The consumption bonus of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.consumption_bonus)
---@field consumption_bonus double
---[RW]
---Multiplies the energy consumption.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.consumption_modifier)
---
---_Can only be used if this is Car_
---@field consumption_modifier float
---[RW]
---Whether this corpse will ever fade away.
---
---**Note:** Useable only on corpses.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.corpse_expires)
---@field corpse_expires boolean
---[RW]
---If true, corpse won't be destroyed when entities are placed over it. If false, whether corpse will be removed or not depends on value of CorpsePrototype::remove_on_entity_placement.
---
---**Note:** Useable only on corpses.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.corpse_immune_to_entity_placement)
---@field corpse_immune_to_entity_placement boolean
---[RW]
---The current crafting progress, as a number in range [0, 1].
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.crafting_progress)
---
---_Can only be used if this is CraftingMachine_
---@field crafting_progress float
---[R]
---The current crafting speed, including speed bonuses from modules and beacons.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.crafting_speed)
---
---_Can only be used if this is CraftingMachine_
---@field crafting_speed double
---[RW]
---The damage dealt by this turret, artillery turret, or artillery wagon.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.damage_dealt)
---
---_Can only be used if this is Turret_
---@field damage_dealt double
---[RW]
---If set to `false`, this entity can't be damaged and won't be attacked automatically. It can however still be mined.
---
---**Note:** Entities that are indestructible naturally (they have no health, like smoke, resource etc) can't be set to be destructible.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destructible)
---@field destructible boolean
---[RW]
---The current direction this entity is facing.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.direction)
---@field direction defines.direction
---[R]
---The distraction command given to this unit, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.distraction_command)
---
---_Can only be used if this is Unit_
---@field distraction_command? Command
---[RW]
---Whether the driver of this car or spidertron is the gunner. If `false`, the passenger is the gunner. `nil` if this is neither a car or a spidertron.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.driver_is_gunner)
---@field driver_is_gunner? boolean
---[RW]
---Position where the entity puts its stuff.
---
---**Note:** Meaningful only for entities that put stuff somewhere, such as mining drills or inserters. Mining drills can't have their drop position changed; inserters must have `allow_custom_vectors` set to true on their prototype to allow changing the drop position.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.drop_position)
---@field drop_position MapPosition
---[RW]
---The entity this entity is putting its items to. If there are multiple possible entities at the drop-off point, writing to this attribute allows a mod to choose which one to drop off items to. The entity needs to collide with the tile box under the drop-off position. `nil` if there is no entity to put items to, or if this is not an entity that puts items somewhere.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.drop_target)
---@field drop_target? LuaEntity
---[R]
---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. `nil` if this is not a unit.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effective_speed)
---
---_Can only be used if this is Unit_
---@field effective_speed? float
---[RW]
---Multiplies the acceleration the vehicle can create for one unit of energy. Defaults to `1`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effectivity_modifier)
---
---_Can only be used if this is Car_
---@field effectivity_modifier float
---[R]
---The effects being applied to this entity, if any. For beacons, this is the effect the beacon is broadcasting.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effects)
---@field effects? ModuleEffects
---[RW]
---The buffer size for the electric energy source. `nil` if the entity doesn't have an electric energy source.
---
---**Note:** Write access is limited to the ElectricEnergyInterface type
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_buffer_size)
---@field electric_buffer_size? double
---[R]
---The electric drain for the electric energy source. `nil` if the entity doesn't have an electric energy source.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_drain)
---@field electric_drain? double
---[R]
---The emissions for the electric energy source. `nil` if the entity doesn't have an electric energy source.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_emissions)
---@field electric_emissions? double
---[R]
---The input flow limit for the electric energy source. `nil` if the entity doesn't have an electric energy source.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_input_flow_limit)
---@field electric_input_flow_limit? double
---[R]
---Returns the id of the electric network that this entity is connected to, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_network_id)
---@field electric_network_id? uint
---[R]
---The electric network statistics for this electric pole.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_network_statistics)
---
---_Can only be used if this is ElectricPole_
---@field electric_network_statistics LuaFlowStatistics
---[R]
---The output flow limit for the electric energy source. `nil` if the entity doesn't have an electric energy source.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.electric_output_flow_limit)
---@field electric_output_flow_limit? double
---[RW]
---Whether equipment grid logistics are enabled while this vehicle is moving.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.enable_logistics_while_moving)
---
---_Can only be used if this is Vehicle_
---@field enable_logistics_while_moving boolean
---[RW]
---Energy stored in the entity (heat in furnace, energy stored in electrical devices etc.). always 0 for entities that don't have the concept of energy stored inside.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy)
---
---### Example
---```
---game.player.print("Machine energy: " .. game.player.selected.energy .. "J")
---game.player.selected.energy = 3000
---```
---@field energy double
---[R]
---How much energy this generator generated in the last tick.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.energy_generated_last_tick)
---
---_Can only be used if this is Generator_
---@field energy_generated_last_tick double
---[RW]
---The label on this entity, if any. `nil` if this is not a spider-vehicule.
---
---**Events:**
--- * Will raise [on_entity_renamed](https://lua-api.factorio.com/latest/events.html#on_entity_renamed) instantly.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.entity_label)
---@field entity_label? string
---[R]
---The number of filter slots this inserter, loader, or logistic storage container has. 0 if not one of those entities.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.filter_slot_count)
---@field filter_slot_count uint
---[RW]
---Fluidboxes of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.fluidbox)
---@field fluidbox LuaFluidBox
---[RW]
---The follow offset of this spidertron, if any entity is being followed. This is randomized each time the follow entity is set.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.follow_offset)
---
---_Can only be used if this is SpiderVehicle_
---@field follow_offset? Vector
---[RW]
---The follow target of this spidertron, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.follow_target)
---
---_Can only be used if this is SpiderVehicle_
---@field follow_target? LuaEntity
---[RW]
---Multiplies the car friction rate.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.friction_modifier)
---
---### Example
---This will allow the car to go much faster
---```
---game.player.vehicle.friction_modifier = 0.5
---```
---
---_Can only be used if this is Car_
---@field friction_modifier float
---[R]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_localised_description)
---
---_Can only be used if this is Ghost_
---@field ghost_localised_description LocalisedString
---[R]
---Localised name of the entity or tile contained in this ghost.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_localised_name)
---
---_Can only be used if this is Ghost_
---@field ghost_localised_name LocalisedString
---[R]
---Name of the entity or tile contained in this ghost
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_name)
---
---_Can only be used if this is Ghost_
---@field ghost_name string
---[R]
---The prototype of the entity or tile contained in this ghost.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_prototype)
---
---_Can only be used if this is Ghost_
---@field ghost_prototype LuaEntityPrototype|LuaTilePrototype
---[R]
---The prototype type of the entity or tile contained in this ghost.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_type)
---
---_Can only be used if this is Ghost_
---@field ghost_type string
---[R]
---The [unit_number](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number) of the entity contained in this ghost. It is the same as the unit number of the [EntityWithOwner](https://wiki.factorio.com/Prototype/EntityWithOwner) that was destroyed to create this ghost. If it was created by other means, or if the inner entity does not support unit numbers, this property is `nil`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_unit_number)
---
---_Can only be used if this is EntityGhost_
---@field ghost_unit_number? uint
---[RW]
---The graphics variation for this entity. `nil` if this entity doesn't use graphics variations.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.graphics_variation)
---@field graphics_variation? uint8
---[R]
---This entity's equipment grid, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.grid)
---@field grid? LuaEquipmentGrid
---[RW]
---The current health of the entity, if any. Health is automatically clamped to be between `0` and max health (inclusive). Entities with a health of `0` can not be attacked.
---
---**Note:** To get the maximum possible health of this entity, see [LuaEntityPrototype::max_health](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_health) on its prototype.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.health)
---@field health? float
---[R]
---The item stack currently held in an inserter's hand.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.held_stack)
---
---_Can only be used if this is Inserter_
---@field held_stack LuaItemStack
---[R]
---Current position of the inserter's "hand".
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.held_stack_position)
---
---_Can only be used if this is Inserter_
---@field held_stack_position MapPosition
---[RW]
---The blink interval of this highlight box entity. 0 indicates no blink.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.highlight_box_blink_interval)
---
---_Can only be used if this is HighlightBox_
---@field highlight_box_blink_interval uint
---[RW]
---The hightlight box type of this highlight box entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.highlight_box_type)
---
---_Can only be used if this is HighlightBox_
---@field highlight_box_type string
---[RW]
---The filters for this infinity container.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.infinity_container_filters)
---
---_Can only be used if this is InfinityContainer_
---@field infinity_container_filters InfinityInventoryFilter[]
---[RW]
---Count of initial resource units contained. `nil` if this is not an infinite resource.
---
---**Note:** If this is not an infinite resource, writing will produce an error.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.initial_amount)
---
---_Can only be used if this is ResourceEntity_
---@field initial_amount? uint
---[RW]
---The filter mode for this filter inserter. Either `"whitelist"` or `"blacklist"`. `nil` if this inserter doesn't use filters.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.inserter_filter_mode)
---
---_Can only be used if this is Inserter_
---@field inserter_filter_mode? string
---[RW]
---Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored.
---
---**Note:** Set to 0 to reset.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.inserter_stack_size_override)
---@field inserter_stack_size_override uint
---[R]
---(deprecated by 1.1.51) If this entity is a MilitaryTarget. Returns same value as LuaEntity::is_military_target
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_force)
---@field is_entity_with_force boolean
---[R]
---If this entity is EntityWithHealth
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_health)
---@field is_entity_with_health boolean
---[R]
---If this entity is EntityWithOwner
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_entity_with_owner)
---@field is_entity_with_owner boolean
---[RW]
---Whether this entity is a MilitaryTarget. Can be written to if [LuaEntityPrototype::allow_run_time_change_of_is_military_target](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.allow_run_time_change_of_is_military_target) returns `true`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_military_target)
---@field is_military_target boolean
---[RW]
---Items this ghost will request when revived or items this item request proxy is requesting. Result is a dictionary mapping each item prototype name to the required count.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.item_requests)
---@field item_requests {[string]: uint}
---[RW]
---The number of units killed by this turret, artillery turret, or artillery wagon.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.kills)
---
---_Can only be used if this is Turret_
---@field kills uint
---[RW]
---The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. `nil` if the last user is not part of the save anymore.
---
---Reading this property will return a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), while [PlayerIdentification](https://lua-api.factorio.com/latest/Concepts.html#PlayerIdentification) can be used when writing.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.last_user)
---
---_Can only be used if this is EntityWithOwner_
---@field last_user? LuaPlayer|PlayerIdentification
---[RW]
---The link ID this linked container is using.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.link_id)
---@field link_id uint
---[R]
---Neighbour to which this linked belt is connected to, if any.
---
---**Note:** Can also be used on entity ghost if it contains linked-belt
---
---**Note:** May return entity ghost which contains linked belt to which connection is made
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.linked_belt_neighbour)
---
---_Can only be used if this is LinkedBelt_
---@field linked_belt_neighbour? LuaEntity
---[RW]
---Type of linked belt: it is either `"input"` or `"output"`. Changing type will also flip direction so the belt is out of the same side
---
---**Note:** Can only be changed when linked belt is disconnected (has no neighbour set)
---
---**Note:** Can also be used on entity ghost if it contains linked-belt
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.linked_belt_type)
---
---_Can only be used if this is LinkedBelt_
---@field linked_belt_type string
---[R]
---The container entity this loader is pointing at/pulling from depending on the [LuaEntity::loader_type](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_type), if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_container)
---
---_Can only be used if this is Loader_
---@field loader_container? LuaEntity
---[RW]
---`"input"` or `"output"`, depending on whether this loader puts to or gets from a container.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_type)
---
---_Can only be used if this is Loader_
---@field loader_type string
---[R]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.localised_description)
---@field localised_description LocalisedString
---[R]
---Localised name of the entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.localised_name)
---@field localised_name LocalisedString
---[R]
---The logistic cell this entity is a part of. Will be `nil` if this entity is not a part of any logistic cell.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.logistic_cell)
---@field logistic_cell LuaLogisticCell
---[RW]
---The logistic network this entity is a part of, or `nil` if this entity is not a part of any logistic network.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.logistic_network)
---@field logistic_network LuaLogisticNetwork
---[RW]
---
---**Note:** Not minable entities can still be destroyed.
---
---**Note:** Entities that are not minable naturally (like smoke, character, enemy units etc) can't be set to minable.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.minable)
---@field minable boolean
---[RW]
---The mining progress for this mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time]. `nil` if this isn't a mining drill.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mining_progress)
---@field mining_progress? double
---[R]
---The mining target, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mining_target)
---
---_Can only be used if this is MiningDrill_
---@field mining_target? LuaEntity
---[R]
---Returns true if this unit is moving.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.moving)
---
---_Can only be used if this is Unit_
---@field moving boolean
---[R]
---Name of the entity prototype. E.g. "inserter" or "filter-inserter".
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.name)
---@field name string
---[R]
---The current total neighbour bonus of this reactor.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbour_bonus)
---
---_Can only be used if this is Reactor_
---@field neighbour_bonus double
---[R]
---A list of neighbours for certain types of entities. Applies to electric poles, power switches, underground belts, walls, gates, reactors, cliffs, and pipe-connectable entities.
---
---- When called on an electric pole, this is a dictionary of all connections, indexed by the strings `"copper"`, `"red"`, and `"green"`.
---- When called on a pipe-connectable entity, this is an array of entity arrays of all entities a given fluidbox is connected to.
---- When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none.
---- When called on a wall-connectable entity or reactor, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
---- When called on a cliff entity, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.neighbours)
---@field neighbours {[string]: LuaEntity[]}|LuaEntity[][]|LuaEntity
---[R]
---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.object_name)
---@field object_name string
---[RW]
---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.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.operable)
---@field operable boolean
---[RW]
---The smooth orientation of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.orientation)
---@field orientation RealOrientation
---[RW]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.parameters)
---
---_Can only be used if this is ProgrammableSpeaker_
---@field parameters ProgrammableSpeakerParameters
---[RW]
---Where the inserter will pick up items from.
---
---**Note:** Inserters must have `allow_custom_vectors` set to true on their prototype to allow changing the pickup position.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pickup_position)
---
---_Can only be used if this is Inserter_
---@field pickup_position MapPosition
---[RW]
---The entity this inserter will attempt to pick up items from. If there are multiple possible entities at the pick-up point, writing to this attribute allows a mod to choose which one to pick up items from. The entity needs to collide with the tile box under the pick-up position. `nil` if there is no entity to pull items from.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pickup_target)
---
---_Can only be used if this is Inserter_
---@field pickup_target? LuaEntity
---[R]
---The player connected to this character, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.player)
---
---_Can only be used if this is Character_
---@field player? LuaPlayer
---[R]
---The pollution bonus of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pollution_bonus)
---@field pollution_bonus double
---[RW]
---The power production specific to the ElectricEnergyInterface entity type.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.power_production)
---
---_Can only be used if this is ElectricEnergyInterface_
---@field power_production double
---[RW]
---The state of this power switch.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.power_switch_state)
---@field power_switch_state boolean
---[RW]
---The power usage specific to the ElectricEnergyInterface entity type.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.power_usage)
---
---_Can only be used if this is ElectricEnergyInterface_
---@field power_usage double
---[R]
---The previous recipe this furnace was using, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.previous_recipe)
---
---_Can only be used if this is Furnace_
---@field previous_recipe? LuaRecipe
---[R]
---The productivity bonus of this entity.
---
---**Note:** This includes force based bonuses as well as beacon/module bonuses.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.productivity_bonus)
---@field productivity_bonus double
---[RW]
---The number of products this machine finished crafting in its lifetime.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.products_finished)
---
---_Can only be used if this is CraftingMachine_
---@field products_finished uint
---[R]
---The entity prototype of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.prototype)
---@field prototype LuaEntityPrototype
---[R]
---The target entity for this item-request-proxy, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.proxy_target)
---@field proxy_target? LuaEntity
---[R]
---The rail target of this pump, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.pump_rail_target)
---
---_Can only be used if this is Pump_
---@field pump_rail_target? LuaEntity
---[R]
---The current radar scan progress, as a number in range [0, 1].
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.radar_scan_progress)
---
---_Can only be used if this is Radar_
---@field radar_scan_progress float
---[RW]
---When locked; the recipe in this assembling machine can't be changed by the player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.recipe_locked)
---
---_Can only be used if this is AssemblingMachine_
---@field recipe_locked boolean
---[RW]
---The relative orientation of the vehicle turret, artillery turret, artillery wagon. `nil` if this entity isn't a vehicle with a vehicle turret or artillery turret/wagon.
---
---**Note:** Writing does nothing if the vehicle doesn't have a turret.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.relative_turret_orientation)
---@field relative_turret_orientation? RealOrientation
---[RW]
---Whether items not included in this infinity container filters should be removed from the container.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_unfiltered_items)
---
---_Can only be used if this is InfinityContainer_
---@field remove_unfiltered_items boolean
---[RW]
---The player that this `simple-entity-with-owner`, `simple-entity-with-force`, `flying-text`, or `highlight-box` is visible to. `nil` when this entity is rendered for all players.
---
---Reading this property will return a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html), while [PlayerIdentification](https://lua-api.factorio.com/latest/Concepts.html#PlayerIdentification) can be used when writing.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_player)
---@field render_player? LuaPlayer|PlayerIdentification
---[RW]
---The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. `nil` or an empty array when this entity is rendered for all forces.
---
---**Note:** Reading will always give an array of [LuaForce](https://lua-api.factorio.com/latest/LuaForce.html)
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.render_to_forces)
---@field render_to_forces? ForceIdentification[]
---[RW]
---Whether this requester chest is set to also request from buffer chests.
---
---**Note:** Useable only on entities that have requester slots.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_from_buffers)
---@field request_from_buffers boolean
---[R]
---The index of the configured request with the highest index for this entity. This means 0 if no requests are set and e.g. 20 if the 20th request slot is configured.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_slot_count)
---@field request_slot_count uint
---[RW]
---Number of rocket parts in the silo.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rocket_parts)
---
---_Can only be used if this is RocketSilo_
---@field rocket_parts uint
---[R]
---The status of this rocket silo entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rocket_silo_status)
---@field rocket_silo_status defines.rocket_silo_status
---[RW]
---When entity is not to be rotatable (inserter, transport belt etc), it can't be rotated by player using the R key.
---
---**Note:** Entities that are not rotatable naturally (like chest or furnace) can't be set to be rotatable.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotatable)
---@field rotatable boolean
---[R]
---The secondary bounding box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_bounding_box)
---@field secondary_bounding_box? BoundingBox
---[R]
---The secondary selection box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.secondary_selection_box)
---@field secondary_selection_box? BoundingBox
---[RW]
---Index of the currently selected weapon slot of this character, car, or spidertron. `nil` if this entity doesn't have guns.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.selected_gun_index)
---
---_Can only be used if this is Character or Car_
---@field selected_gun_index? uint
---[R]
---[LuaEntityPrototype::selection_box](https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.selection_box) around entity's given position and respecting the current entity orientation.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.selection_box)
---@field selection_box BoundingBox
---[RW]
---The shooting target for this turret, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.shooting_target)
---@field shooting_target? LuaEntity
---[R]
---The state of this rail signal.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.signal_state)
---
---_Can only be used if this is RailSignal or RailChainSignal_
---@field signal_state defines.signal_state
---[R]
---The spawner associated with this unit entity, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.spawner)
---@field spawner? LuaEntity
---[RW]
---The current speed if this is a car, rolling stock, projectile or spidertron, or the maximum speed if this is a unit. The speed is in tiles per tick. `nil` if this is not a car, rolling stock, unit, projectile or spidertron.
---
---Only the speed of units, cars, and projectiles are writable.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.speed)
---@field speed? float
---[R]
---The speed bonus of this entity.
---
---**Note:** This includes force based bonuses as well as beacon/module bonuses.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.speed_bonus)
---@field speed_bonus double
---[RW]
---The filter for this splitter, if any is set.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.splitter_filter)
---
---_Can only be used if this is Splitter_
---@field splitter_filter? LuaItemPrototype
---[RW]
---The input priority for this splitter. Either `"left"`, `"none"`, or `"right"`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.splitter_input_priority)
---
---_Can only be used if this is Splitter_
---@field splitter_input_priority string
---[RW]
---The output priority for this splitter. Either `"left"`, `"none"`, or `"right"`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.splitter_output_priority)
---
---_Can only be used if this is Splitter_
---@field splitter_output_priority string
---[R]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stack)
---
---_Can only be used if this is ItemEntity_
---@field stack LuaItemStack
---[R]
---The status of this entity, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.status)
---@field status? defines.entity_status
---[R]
---The entity this sticker is sticked to.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.sticked_to)
---@field sticked_to LuaEntity
---[R]
---The sticker entities attached to this entity, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stickers)
---@field stickers? LuaEntity[]
---[RW]
---The storage filter for this logistic storage container.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.storage_filter)
---@field storage_filter LuaItemPrototype
---[R]
---Whether the entity has direction. When it is false for this entity, it will always return north direction when asked for.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.supports_direction)
---@field supports_direction boolean
---[RW]
---The tags associated with this entity ghost. `nil` if this is not an entity ghost.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tags)
---@field tags? Tags
---[RW]
---The temperature of this entity's heat energy source. `nil` if this entity does not use a heat energy source.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.temperature)
---@field temperature? double
---[RW]
---The text of this flying-text entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.text)
---
---_Can only be used if this is FlyingText_
---@field text LocalisedString
---[RW]
---The last tick this character entity was attacked.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tick_of_last_attack)
---
---_Can only be used if this is Character_
---@field tick_of_last_attack uint
---[RW]
---The last tick this character entity was damaged.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tick_of_last_damage)
---
---_Can only be used if this is Character_
---@field tick_of_last_damage uint
---[R]
---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). Uses the current direction of the entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tile_height)
---@field tile_height uint
---[R]
---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). Uses the current direction of the entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tile_width)
---@field tile_width uint
---[RW]
---The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
---
---- for ghosts set to uint32 max (4,294,967,295) to never expire.
---- for ghosts Cannot be set higher than [LuaForce::ghost_time_to_live](https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.ghost_time_to_live) of the entity's force.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_live)
---@field time_to_live uint
---[RW]
---The ticks until the next trigger effect of this smoke-with-trigger.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.time_to_next_effect)
---
---_Can only be used if this is SmokeWithTrigger_
---@field time_to_next_effect uint
---[RW]
---The timeout that's left on this landmine in ticks. It describes the time between the landmine being placed and it being armed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.timeout)
---
---_Can only be used if this is LandMine_
---@field timeout uint
---[RW]
---Will this entity be picked up automatically when the player walks over it?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_looted)
---
---_Can only be used if this is ItemEntity_
---@field to_be_looted boolean
---[RW]
---The torso orientation of this spider vehicle.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.torso_orientation)
---
---_Can only be used if this is SpiderVehicle_
---@field torso_orientation RealOrientation
---[R]
---The train this rolling stock belongs to, if any. `nil` if this is not a rolling stock.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.train)
---@field train? LuaTrain
---[R]
---Amount of trains related to this particular train stop. Includes train stopped at this train stop (until it finds a path to next target) and trains having this train stop as goal or waypoint.
---
---**Note:** Train may be included multiple times when braking distance covers this train stop multiple times
---
---**Note:** Value may be read even when train stop has no control behavior
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_count)
---
---_Can only be used if this is TrainStop_
---@field trains_count uint
---[R]
---The number of trains in this rail block for this rail entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_in_block)
---
---_Can only be used if this is Rail_
---@field trains_in_block uint
---[RW]
---Amount of trains above which no new trains will be sent to this train stop. Writing nil will disable the limit (will set a maximum possible value).
---
---**Note:** When a train stop has a control behavior with wire connected and set_trains_limit enabled, this value will be overwritten by it
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.trains_limit)
---
---_Can only be used if this is TrainStop_
---@field trains_limit uint
---[RW]
---Index of the tree color.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_color_index)
---@field tree_color_index uint8
---[R]
---Maximum index of the tree colors.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_color_index_max)
---@field tree_color_index_max uint8
---[RW]
---Index of the tree gray stage
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_gray_stage_index)
---@field tree_gray_stage_index uint8
---[R]
---Maximum index of the tree gray stages.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_gray_stage_index_max)
---@field tree_gray_stage_index_max uint8
---[RW]
---Index of the tree stage.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_stage_index)
---@field tree_stage_index uint8
---[R]
---Maximum index of the tree stages.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.tree_stage_index_max)
---@field tree_stage_index_max uint8
---[R]
---The entity prototype type of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.type)
---@field type string
---[R]
---The unit group this unit is a member of, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_group)
---
---_Can only be used if this is Unit_
---@field unit_group? LuaUnitGroup
---[R]
---A universally unique number identifying this entity for the lifetime of the save. Only entities inheriting from [EntityWithOwner](https://wiki.factorio.com/Prototype/EntityWithOwner), as well as [ItemRequestProxy](https://wiki.factorio.com/Prototype/ItemRequestProxy) and [EntityGhost](https://wiki.factorio.com/Prototype/EntityGhost) are assigned a unit number. `nil` if this entity doesn't have a unit number.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number)
---@field unit_number? uint
---[R]
---The units associated with this spawner entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.units)
---@field units LuaEntity[]
---[R]
---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.valid)
---@field valid boolean
---[RW]
---Read when this spidertron auto-targets enemies
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.vehicle_automatic_targeting_parameters)
---
---_Can only be used if this is SpiderVehicle_
---@field vehicle_automatic_targeting_parameters VehicleAutomaticTargetingParameters
local LuaEntity={
---Adds the given position to this spidertron's autopilot's queue of destinations.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.add_autopilot_destination)
---
---_Can only be used if this is SpiderVehicle_
---@param position MapPosition@The position the spidertron should move to.
add_autopilot_destination=function(position)end,
---Offer a thing on the market.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.add_market_item)
---
---### Example
---Adds market offer, 1 copper ore for 10 iron ore.
---```
---market.add_market_item{price={{"iron-ore", 10}}, offer={type="give-item", item="copper-ore"}}
---```
---
---### Example
---Adds market offer, 1 copper ore for 5 iron ore and 5 stone ore.
---```
---market.add_market_item{price={{"iron-ore", 5}, {"stone", 5}}, offer={type="give-item", item="copper-ore"}}
---```
---
---_Can only be used if this is Market_
---@param offer Offer
add_market_item=function(offer)end,
---Checks if the entity can be destroyed
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.can_be_destroyed)
---@return boolean@Whether the entity can be destroyed.
can_be_destroyed=function()end,
---Whether this character can shoot the given entity or position.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.can_shoot)
---@param target LuaEntity
---@param position MapPosition
---@return boolean
can_shoot=function(target,position)end,
---Can wires reach between these entities.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.can_wires_reach)
---@param entity LuaEntity
---@return boolean
can_wires_reach=function(entity)end,
---Cancels deconstruction if it is scheduled, does nothing otherwise.
---
---**Events:**
--- * May raise [on_cancelled_deconstruction](https://lua-api.factorio.com/latest/events.html#on_cancelled_deconstruction) instantly.
---Raised if the entity's deconstruction was successfully cancelled.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.cancel_deconstruction)
---@param force ForceIdentification@The force who did the deconstruction order.
---@param player PlayerIdentification?@The player to set the `last_user` to if any.
cancel_deconstruction=function(force,player)end,
---Cancels upgrade if it is scheduled, does nothing otherwise.
---
---**Events:**
--- * May raise [on_cancelled_upgrade](https://lua-api.factorio.com/latest/events.html#on_cancelled_upgrade) instantly.
---Raised if the entity way previously marked for upgrade.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.cancel_upgrade)
---@param force ForceIdentification@The force who did the upgrade order.
---@param player PlayerIdentification?@The player to set the last_user to if any.
---@return boolean@Whether the cancel was successful.
cancel_upgrade=function(force,player)end,
---Remove all fluids from this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clear_fluid_inside)
clear_fluid_inside=function()end,
---Removes all offers from a market.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clear_market_items)
---
---_Can only be used if this is Market_
clear_market_items=function()end,
---Clear a logistic requester slot.
---
---**Note:** Useable only on entities that have requester slots.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clear_request_slot)
---@param slot uint@The slot index.
clear_request_slot=function(slot)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone)
---@class LuaEntity.clone_param
---The destination position
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone)
---@field position MapPosition
---The destination surface
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone)
---@field surface? LuaSurface
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone)
---@field force? ForceIdentification
---If false, the building effect smoke will not be shown around the new entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone)
---@field create_build_effect_smoke? boolean
---Clones this entity.
---
---**Events:**
--- * May raise [on_entity_cloned](https://lua-api.factorio.com/latest/events.html#on_entity_cloned) instantly.
---Raised if the entity was successfully cloned.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.clone)
---@param param LuaEntity.clone_param
---@return LuaEntity?@The cloned entity or `nil` if this entity can't be cloned/can't be cloned to the given location.
clone=function(param)end,
---Connects current linked belt with another one.
---
---Neighbours have to be of different type. If given linked belt is connected to something else it will be disconnected first. If provided neighbour is connected to something else it will also be disconnected first. Automatically updates neighbour to be connected back to this one.
---
---**Note:** Can also be used on entity ghost if it contains linked-belt
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connect_linked_belts)
---
---_Can only be used if this is LinkedBelt_
---@param neighbour LuaEntity@Another linked belt or entity ghost containing linked belt to connect or nil to disconnect
connect_linked_belts=function(neighbour)end,
---Connect two devices with a circuit wire or copper cable. Depending on which type of connection should be made, there are different procedures:
---
---- To connect two electric poles, `target` must be a [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) that specifies another electric pole. This will connect them with copper cable.
---- To connect two devices with circuit wire, `target` must be a table of type [WireConnectionDefinition](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connect_neighbour)
---@param target LuaEntity|WireConnectionDefinition@The target with which to establish a connection.
---@return boolean@Whether the connection was successfully formed.
connect_neighbour=function(target)end,
---Connects the rolling stock in the given direction.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.connect_rolling_stock)
---@param direction defines.rail_direction
---@return boolean@Whether any connection was made
connect_rolling_stock=function(direction)end,
---Copies settings from the given entity onto this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.copy_settings)
---@param entity LuaEntity
---@param by_player PlayerIdentification?@If provided, the copying is done 'as' this player and [on_entity_settings_pasted](https://lua-api.factorio.com/latest/events.html#on_entity_settings_pasted) is triggered.
---@return {[string]: uint}@Any items removed from this entity as a result of copying the settings.
copy_settings=function(entity,by_player)end,
---Creates the same smoke that is created when you place a building by hand. You can play the building sound to go with it by using [LuaSurface::play_sound](https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound), eg: entity.surface.play_sound{path="entity-build/"..entity.prototype.name, position=entity.position}
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.create_build_effect_smoke)
create_build_effect_smoke=function()end,
---Damages the entity.
---
---**Events:**
--- * Will raise [on_entity_damaged](https://lua-api.factorio.com/latest/events.html#on_entity_damaged) instantly.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.damage)
---
---_Can only be used if this is EntityWithHealth_
---@param damage float@The amount of damage to be done.
---@param force ForceIdentification@The force that will be doing the damage.
---@param type string?@The type of damage to be done, defaults to "impact".
---@param dealer LuaEntity?@The entity to consider as the damage dealer. Needs to be on the same surface as the entity being damaged.
---@return float@the total damage actually applied after resistances.
damage=function(damage,force,type,dealer)end,
---Depletes and destroys this resource entity.
---
---**Events:**
--- * Will raise [on_resource_depleted](https://lua-api.factorio.com/latest/events.html#on_resource_depleted) instantly.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.deplete)
---
---_Can only be used if this is ResourceEntity_
deplete=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy)
---@class LuaEntity.destroy_param
---Whether neighbouring cliffs should be corrected. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy)
---@field do_cliff_correction? boolean
---If `true`, [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) will be called. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy)
---@field raise_destroy? boolean
---Destroys the entity.
---
---**Note:** Not all entities can be destroyed - things such as rails under trains cannot be destroyed until the train is moved or destroyed.
---
---**Events:**
--- * May raise [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) instantly.
---Raised if the `raise_destroy` flag was set and the entity was successfully destroyed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy)
---@param param?LuaEntity.destroy_param
---@return boolean@Returns `false` if the entity was valid and destruction failed, `true` in all other cases.
destroy=function(param)end,
---Immediately kills the entity. Does nothing if the entity doesn't have health.
---
---Unlike [LuaEntity::destroy](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.destroy), `die` will trigger the [on_entity_died](https://lua-api.factorio.com/latest/events.html#on_entity_died) event and the entity will produce a corpse and drop loot if it has any.
---
---**Events:**
--- * May raise [on_entity_died](https://lua-api.factorio.com/latest/events.html#on_entity_died) instantly.
---Raised if the entity was successfully killed. If `force` is not specified, the event will blame the `"neutral"` force.
---
--- * May raise [on_post_entity_died](https://lua-api.factorio.com/latest/events.html#on_post_entity_died) instantly.
---Raised if the entity was successfully killed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.die)
---
---### Example
---This function can be called with only the `cause` argument and no `force`:
---```
---entity.die(nil, killer_entity)
---```
---@param force ForceIdentification?@The force to attribute the kill to.
---@param cause LuaEntity?@The cause to attribute the kill to.
---@return boolean@Whether the entity was successfully killed.
die=function(force,cause)end,
---Disconnects linked belt from its neighbour.
---
---**Note:** Can also be used on entity ghost if it contains linked-belt
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_linked_belts)
---
---_Can only be used if this is LinkedBelt_
disconnect_linked_belts=function()end,
---Disconnect circuit wires or copper cables between devices. Depending on which type of connection should be cut, there are different procedures:
---
---- To remove all copper cables, leave the `target` parameter blank: `pole.disconnect_neighbour()`.
---- To remove all wires of a specific color, set `target` to [defines.wire_type.red](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.red) or [defines.wire_type.green](https://lua-api.factorio.com/latest/defines.html#defines.wire_type.green).
---- To remove a specific copper cable between two electric poles, `target` must be a [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) that specifies the other pole: `pole1.disconnect_neighbour(pole2)`.
---- To remove a specific circuit wire, `target` must be a table of type [WireConnectionDefinition](https://lua-api.factorio.com/latest/Concepts.html#WireConnectionDefinition).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_neighbour)
---@param target defines.wire_type|LuaEntity|WireConnectionDefinition?@The target with which to cut a connection.
disconnect_neighbour=function(target)end,
---Tries to disconnect this rolling stock in the given direction.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.disconnect_rolling_stock)
---@param direction defines.rail_direction
---@return boolean@If anything was disconnected
disconnect_rolling_stock=function(direction)end,
---Get the source of this beam.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beam_source)
---
---_Can only be used if this is Beam_
---@return BeamTarget?
get_beam_source=function()end,
---Get the target of this beam.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beam_target)
---
---_Can only be used if this is Beam_
---@return BeamTarget?
get_beam_target=function()end,
---The burnt result inventory for this entity or `nil` if this entity doesn't have a burnt result inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_burnt_result_inventory)
---@return LuaInventory?
get_burnt_result_inventory=function()end,
---Returns all child signals. Child signals can be either RailSignal or RailChainSignal. Child signals are signals which are checked by this signal to determine a chain state.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_child_signals)
---
---_Can only be used if this is RailChainSignal_
---@return LuaEntity[]
get_child_signals=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_circuit_network)
---@param wire defines.wire_type@Wire color of the network connected to this entity.
---@param circuit_connector defines.circuit_connector_id?@The connector to get circuit network for. Must be specified for entities with more than one circuit network connector.
---@return LuaCircuitNetwork?@The circuit network or nil.
get_circuit_network=function(wire,circuit_connector)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail)
---@class LuaEntity.get_connected_rail_param
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail)
---@field rail_direction defines.rail_direction
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail)
---@field rail_connection_direction defines.rail_connection_direction
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rail)
---
---_Can only be used if this is Rail_
---@param param LuaEntity.get_connected_rail_param
---@return LuaEntity?@Rail connected in the specified manner to this one, `nil` if unsuccessful.
---@return defines.rail_direction?@Rail direction of the returned rail which points to origin rail
---@return defines.rail_connection_direction?@Turn to be taken when going back from returned rail to origin rail
get_connected_rail=function(param)end,
---Get the rails that this signal is connected to.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rails)
---
---_Can only be used if this is RailSignal or RailChainSignal_
---@return LuaEntity[]
get_connected_rails=function()end,
---Gets rolling stock connected to the given end of this stock.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_connected_rolling_stock)
---@param direction defines.rail_direction
---@return LuaEntity?@The rolling stock connected at the given end, `nil` if none is connected there.
---@return defines.rail_direction?@The rail direction of the connected rolling stock if any.
get_connected_rolling_stock=function(direction)end,
---Gets the control behavior of the entity (if any).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_control_behavior)
---@return LuaControlBehavior?@The control behavior or `nil`.
get_control_behavior=function()end,
---Returns the amount of damage to be taken by this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_damage_to_be_taken)
---@return float?@`nil` if this entity does not have health.
get_damage_to_be_taken=function()end,
---Gets the driver of this vehicle if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver)
---
---_Can only be used if this is Vehicle_
---@return LuaEntity|LuaPlayer?@`nil` if the vehicle contains no driver. To check if there's a passenger see [LuaEntity::get_passenger](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_passenger).
get_driver=function()end,
---Get the filter for a slot in an inserter, loader, or logistic storage container.
---
---**Note:** The entity must allow filters.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_filter)
---@param slot_index uint@Index of the slot to get the filter for.
---@return string?@Prototype name of the item being filtered. `nil` if the given slot has no filter.
get_filter=function(slot_index)end,
---Get amounts of all fluids in this entity.
---
---**Note:** If information about fluid temperatures is required, [LuaEntity::fluidbox](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.fluidbox) should be used instead.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_fluid_contents)
---@return {[string]: double}@The amounts, indexed by fluid names.
get_fluid_contents=function()end,
---Get the amount of all or some fluid in this entity.
---
---**Note:** If information about fluid temperatures is required, [LuaEntity::fluidbox](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.fluidbox) should be used instead.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_fluid_count)
---@param fluid string?@Prototype name of the fluid to count. If not specified, count all fluids.
---@return double
get_fluid_count=function(fluid)end,
---The fuel inventory for this entity or `nil` if this entity doesn't have a fuel inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_fuel_inventory)
---@return LuaInventory?
get_fuel_inventory=function()end,
---The health ratio of this entity between 1 and 0 (for full health and no health respectively).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_health_ratio)
---@return float?@`nil` if this entity doesn't have health.
get_health_ratio=function()end,
---Gets the heat setting for this heat interface.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_heat_setting)
---
---_Can only be used if this is HeatInterface_
---@return HeatSetting
get_heat_setting=function()end,
---Returns all signals guarding entrance to a rail block this rail belongs to.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_inbound_signals)
---
---_Can only be used if this is Rail_
---@return LuaEntity[]
get_inbound_signals=function()end,
---Gets the filter for this infinity container at the given index or `nil` if the filter index doesn't exist or is empty.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_infinity_container_filter)
---
---_Can only be used if this is InfinityContainer_
---@param index uint@The index to get.
---@return InfinityInventoryFilter?
get_infinity_container_filter=function(index)end,
---Gets the filter for this infinity pipe or `nil` if the filter is empty.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_infinity_pipe_filter)
---
---_Can only be used if this is InfinityPipe_
---@return InfinityPipeFilter?
get_infinity_pipe_filter=function()end,
---Gets all the `LuaLogisticPoint`s that this entity owns. Optionally returns only the point specified by the index parameter.
---
---**Note:** When `index` is not given, this will be a single `LuaLogisticPoint` for most entities. For some (such as the player character), it can be zero or more.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_logistic_point)
---@param index defines.logistic_member_index?@If provided, only returns the `LuaLogisticPoint` specified by this index.
---@return LuaLogisticPoint|LuaLogisticPoint[]?
get_logistic_point=function(index)end,
---Get all offers in a market as an array.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_market_items)
---
---_Can only be used if this is Market_
---@return Offer[]
get_market_items=function()end,
---Get the maximum transport line index of a belt or belt connectable entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_max_transport_line_index)
---
---_Can only be used if this is TransportBeltConnectable_
---@return uint
get_max_transport_line_index=function()end,
---Read a single signal from the combined circuit networks.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_merged_signal)
---@param signal SignalID@The signal to read.
---@param circuit_connector defines.circuit_connector_id?@The connector to get signals for. Must be specified for entities with more than one circuit network connector.
---@return int@The current value of the signal.
get_merged_signal=function(signal,circuit_connector)end,
---The merged circuit network signals or `nil` if there are no signals.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_merged_signals)
---@param circuit_connector defines.circuit_connector_id?@The connector to get signals for. Must be specified for entities with more than one circuit network connector.
---@return Signal[]?@The sum of signals on both the red and green networks, or `nil` if it doesn't have a circuit connector.
get_merged_signals=function(circuit_connector)end,
---Inventory for storing modules of this entity; `nil` if this entity has no module inventory.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_module_inventory)
---@return LuaInventory?
get_module_inventory=function()end,
---Gets (and or creates if needed) the control behavior of the entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_or_create_control_behavior)
---@return LuaControlBehavior?@The control behavior or `nil`.
get_or_create_control_behavior=function()end,
---Returns all signals guarding exit from a rail block this rail belongs to.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_outbound_signals)
---
---_Can only be used if this is Rail_
---@return LuaEntity[]
get_outbound_signals=function()end,
---Gets the entity's output inventory if it has one.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_output_inventory)
---@return LuaInventory?@A reference to the entity's output inventory.
get_output_inventory=function()end,
---Returns all parent signals. Parent signals are always RailChainSignal. Parent signals are those signals that are checking state of this signal to determine their own chain state.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_parent_signals)
---
---_Can only be used if this is RailSignal or RailChainSignal_
---@return LuaEntity[]
get_parent_signals=function()end,
---Gets the passenger of this car or spidertron if any.
---
---**Note:** This differs over [LuaEntity::get_driver](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver) in that the passenger can't drive the car.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_passenger)
---
---_Can only be used if this is Vehicle_
---@return LuaEntity|LuaPlayer?@`nil` if the vehicle contains no passenger. To check if there's a driver see [LuaEntity::get_driver](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver).
get_passenger=function()end,
---The radius of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_radius)
---@return double
get_radius=function()end,
---Get the rail at the end of the rail segment this rail is in.
---
---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_end)
---
---_Can only be used if this is Rail_
---@param direction defines.rail_direction
---@return LuaEntity@The rail entity.
---@return defines.rail_direction@A rail direction pointing out of the rail segment from the end rail.
get_rail_segment_end=function(direction)end,
---Get the rail signal or train stop at the start/end of the rail segment this rail is in.
---
---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_entity)
---
---_Can only be used if this is Rail_
---@param direction defines.rail_direction@The direction of travel relative to this rail.
---@param in_else_out boolean@If true, gets the entity at the entrance of the rail segment, otherwise gets the entity at the exit of the rail segment.
---@return LuaEntity?@`nil` if the rail segment doesn't start/end with a signal nor a train stop.
get_rail_segment_entity=function(direction,in_else_out)end,
---Get the length of the rail segment this rail is in.
---
---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_length)
---
---_Can only be used if this is Rail_
---@return double
get_rail_segment_length=function()end,
---Get a rail from each rail segment that overlaps with this rail's rail segment.
---
---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_overlaps)
---
---_Can only be used if this is Rail_
---@return LuaEntity[]
get_rail_segment_overlaps=function()end,
---Get all rails of a rail segment this rail is in
---
---**Note:** A rail segment is a continuous section of rail with no branches, signals, nor train stops.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_rail_segment_rails)
---
---_Can only be used if this is Rail_
---@param direction defines.rail_direction@Selects end of this rail that points to a rail segment end from which to start returning rails
---@return LuaEntity[]@Rails of this rail segment
get_rail_segment_rails=function(direction)end,
---Current recipe being assembled by this machine or `nil` if no recipe is set.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_recipe)
---
---_Can only be used if this is CraftingMachine_
---@return LuaRecipe?
get_recipe=function()end,
---Get a logistic requester slot.
---
---**Note:** Useable only on entities that have requester slots.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_request_slot)
---@param slot uint@The slot index.
---@return SimpleItemStack?@Contents of the specified slot; `nil` if the given slot contains no request.
get_request_slot=function(slot)end,
---Gets legs of given SpiderVehicle.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_spider_legs)
---
---_Can only be used if this is SpiderVehicle_
---@return LuaEntity[]
get_spider_legs=function()end,
---The train currently stopped at this train stop, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_stopped_train)
---
---_Can only be used if this is TrainStop_
---@return LuaTrain?
get_stopped_train=function()end,
---The trains scheduled to stop at this train stop.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_train_stop_trains)
---
---_Can only be used if this is TrainStop_
---@return LuaTrain[]
get_train_stop_trains=function()end,
---Get a transport line of a belt or belt connectable entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_transport_line)
---
---_Can only be used if this is TransportBeltConnectable_
---@param index uint@Index of the requested transport line. Transport lines are 1-indexed.
---@return LuaTransportLine
get_transport_line=function(index)end,
---Returns the new entity direction after upgrading.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_upgrade_direction)
---@return defines.direction?@`nil` if this entity is not marked for upgrade.
get_upgrade_direction=function()end,
---Returns the new entity prototype.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_upgrade_target)
---@return LuaEntityPrototype?@`nil` if this entity is not marked for upgrade.
get_upgrade_target=function()end,
---Same as [LuaEntity::has_flag](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.has_flag), but targets the inner entity on a entity ghost.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.ghost_has_flag)
---
---_Can only be used if this is EntityGhost_
---@param flag string@The flag to test. See [EntityPrototypeFlags](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) for a list of flags.
---@return boolean@`true` if the entity has the given flag set.
ghost_has_flag=function(flag)end,
---Has this unit been assigned a command?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.has_command)
---
---_Can only be used if this is Unit_
---@return boolean
has_command=function()end,
---Test whether this entity's prototype has a certain flag set.
---
---**Note:** `entity.has_flag(f)` is a shortcut for `entity.prototype.has_flag(f)`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.has_flag)
---@param flag string@The flag to test. See [EntityPrototypeFlags](https://lua-api.factorio.com/latest/Concepts.html#EntityPrototypeFlags) for a list of flags.
---@return boolean@`true` if this entity has the given flag set.
has_flag=function(flag)end,
---All methods and properties that this object supports.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.help)
---@return string
help=function()end,
---Insert fluid into this entity. Fluidbox is chosen automatically.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.insert_fluid)
---@param fluid Fluid@Fluid to insert.
---@return double@Amount of fluid actually inserted.
insert_fluid=function(fluid)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_closed)
---
---_Can only be used if this is Gate_
---@return boolean@`true` if this gate is currently closed.
is_closed=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_closing)
---
---_Can only be used if this is Gate_
---@return boolean@`true` if this gate is currently closing
is_closing=function()end,
---Returns `true` if this entity produces or consumes electricity and is connected to an electric network that has at least one entity that can produce power.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_connected_to_electric_network)
---@return boolean
is_connected_to_electric_network=function()end,
---Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether a crafting process has been started in this machine.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_crafting)
---
---_Can only be used if this is CraftingMachine_
---@return boolean
is_crafting=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_opened)
---
---_Can only be used if this is Gate_
---@return boolean@`true` if this gate is currently opened.
is_opened=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_opening)
---
---_Can only be used if this is Gate_
---@return boolean@`true` if this gate is currently opening.
is_opening=function()end,
---Checks if this rail and other rail both belong to the same rail block.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_rail_in_same_rail_block_as)
---
---_Can only be used if this is Rail_
---@param other_rail LuaEntity
---@return boolean
is_rail_in_same_rail_block_as=function(other_rail)end,
---Checks if this rail and other rail both belong to the same rail segment.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_rail_in_same_rail_segment_as)
---
---_Can only be used if this is Rail_
---@param other_rail LuaEntity
---@return boolean
is_rail_in_same_rail_segment_as=function(other_rail)end,
---Is this entity or tile ghost or item request proxy registered for construction? If false, it means a construction robot has been dispatched to build the entity, or it is not an entity that can be constructed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_construction)
---@return boolean
is_registered_for_construction=function()end,
---Is this entity registered for deconstruction with this force? If false, it means a construction robot has been dispatched to deconstruct it, or it is not marked for deconstruction. The complexity is effectively O(1) - it depends on the number of objects targeting this entity which should be small enough.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_deconstruction)
---@param force ForceIdentification@The force construction manager to check.
---@return boolean
is_registered_for_deconstruction=function(force)end,
---Is this entity registered for repair? If false, it means a construction robot has been dispatched to upgrade it, or it is not damaged. This is worst-case O(N) complexity where N is the current number of things in the repair queue.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_repair)
---@return boolean
is_registered_for_repair=function()end,
---Is this entity registered for upgrade? If false, it means a construction robot has been dispatched to upgrade it, or it is not marked for upgrade. This is worst-case O(N) complexity where N is the current number of things in the upgrade queue.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_upgrade)
---@return boolean
is_registered_for_upgrade=function()end,
---**Events:**
--- * May raise [on_rocket_launch_ordered](https://lua-api.factorio.com/latest/events.html#on_rocket_launch_ordered) instantly.
---Raised if the rocket launch was successfully initiated.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.launch_rocket)
---
---_Can only be used if this is RocketSilo_
---@return boolean@`true` if the rocket was successfully launched. Return value of `false` means the silo is not ready for launch.
launch_rocket=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine)
---@class LuaEntity.mine_param
---If provided the item(s) will be transferred into this inventory. If provided, this must be an inventory created with [LuaGameScript::create_inventory](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.create_inventory) or be a basic inventory owned by some entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine)
---@field inventory? LuaInventory
---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 `true` if no inventory is provided.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine)
---@field force? boolean
---If true, [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) will be raised. Defaults to `true`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine)
---@field raise_destroyed? boolean
---If true, the minable state of the entity is ignored. Defaults to `false`. If false, an entity that isn't minable (set as not-minable in the prototype or isn't minable for other reasons) will fail to be mined.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine)
---@field ignore_minable? boolean
---Mines this entity.
---
---**Note:** 'Standard' operation is to keep calling `LuaEntity.mine` with an inventory until all items are transferred and the items dealt with.
---
---**Note:** The result of mining the entity (the item(s) it produces when mined) will be dropped on the ground if they don't fit into the provided inventory.
---
---**Events:**
--- * May raise [script_raised_destroy](https://lua-api.factorio.com/latest/events.html#script_raised_destroy) instantly.
---Raised if the `raise_destroyed` flag was set and the entity was successfully mined.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.mine)
---@param param?LuaEntity.mine_param
---@return boolean@Whether mining succeeded.
mine=function(param)end,
---Sets the entity to be deconstructed by construction robots.
---
---**Events:**
--- * May raise [on_marked_for_deconstruction](https://lua-api.factorio.com/latest/events.html#on_marked_for_deconstruction) instantly.
---Raised if the entity way successfully marked for deconstruction.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_deconstruction)
---@param force ForceIdentification@The force whose robots are supposed to do the deconstruction.
---@param player PlayerIdentification?@The player to set the `last_user` to if any.
---@return boolean@if the entity was marked for deconstruction.
order_deconstruction=function(force,player)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade)
---@class LuaEntity.order_upgrade_param
---The force whose robots are supposed to do the upgrade.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade)
---@field force ForceIdentification
---The prototype of the entity to upgrade to.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade)
---@field target EntityPrototypeIdentification
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade)
---@field player? PlayerIdentification
---The new direction if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade)
---@field direction? defines.direction
---Sets the entity to be upgraded by construction robots.
---
---**Events:**
--- * May raise [on_marked_for_upgrade](https://lua-api.factorio.com/latest/events.html#on_marked_for_upgrade) instantly.
---Raised if the entity way successfully marked for upgrade.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.order_upgrade)
---@param param LuaEntity.order_upgrade_param
---@return boolean@Whether the entity was marked for upgrade.
order_upgrade=function(param)end,
---Plays a note with the given instrument and note.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.play_note)
---
---_Can only be used if this is ProgrammableSpeaker_
---@param instrument uint
---@param note uint
---@return boolean@Whether the request is valid. The sound may or may not be played depending on polyphony settings.
play_note=function(instrument,note)end,
---Release the unit from the spawner which spawned it. This allows the spawner to continue spawning additional units.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.release_from_spawner)
---
---_Can only be used if this is Unit_
release_from_spawner=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@class LuaEntity.remove_fluid_param
---Fluid prototype name.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@field name string
---Amount to remove
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@field amount double
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@field minimum_temperature? double
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@field maximum_temperature? double
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@field temperature? double
---Remove fluid from this entity.
---
---**Note:** If temperature is given only fluid matching that exact temperature is removed. If minimum and maximum is given fluid within that range is removed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_fluid)
---@param param LuaEntity.remove_fluid_param
---@return double@Amount of fluid actually removed.
remove_fluid=function(param)end,
---Remove an offer from a market.
---
---**Note:** The other offers are moved down to fill the gap created by removing the offer, which decrements the overall size of the offer array.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.remove_market_item)
---
---_Can only be used if this is Market_
---@param offer uint@Index of offer to remove.
---@return boolean@`true` if the offer was successfully removed; `false` when the given index was not valid.
remove_market_item=function(offer)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_to_close)
---
---_Can only be used if this is Gate_
---@param force ForceIdentification@The force that requests the gate to be closed.
request_to_close=function(force)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.request_to_open)
---
---_Can only be used if this is Gate_
---@param force ForceIdentification@The force that requests the gate to be open.
---@param extra_time uint?@Extra ticks to stay open.
request_to_open=function(force,extra_time)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive)
---@class LuaEntity.revive_param
---If `true` the function will return item request proxy as the third return value.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive)
---@field return_item_request_proxy? boolean
---If true, and an entity ghost; [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) will be called. Else if true, and a tile ghost; [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) will be called.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive)
---@field raise_revive? boolean
---Revive a ghost. I.e. turn it from a ghost to a real entity or tile.
---
---**Events:**
--- * May raise [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) instantly.
---Raised if this was an entity ghost and the `raise_revive` flag was set and the entity was successfully revived.
---
--- * May raise [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) instantly.
---Raised if this was a tile ghost and the `raise_revive` flag was set and the tile was successfully revived.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.revive)
---@param param?LuaEntity.revive_param
---@return {[string]: uint}?@Any items the new real entity collided with or `nil` if the ghost could not be revived.
---@return LuaEntity?@The revived entity if an entity ghost was successfully revived.
---@return LuaEntity?@The item request proxy if it was requested with `return_item_request_proxy`.
revive=function(param)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@class LuaEntity.rotate_param
---If `true`, rotate the entity in the counter-clockwise direction.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@field reverse? boolean
---If not specified, the [on_player_rotated_entity](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) event will not be fired.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@field by_player? PlayerIdentification
---If the player is not given should extra items be spilled or returned as a second return value from this.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@field spill_items? boolean
---When true, each spilled item will be flagged with the [LuaEntity::to_be_looted](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_looted) flag.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@field enable_looted? boolean
---When provided the spilled items will be marked for deconstruction by this force.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@field force? LuaForce|string
---Rotates this entity as if the player rotated it.
---
---**Events:**
--- * May raise [on_player_rotated_entity](https://lua-api.factorio.com/latest/events.html#on_player_rotated_entity) instantly.
---Raised if the `by_player` argument was given and the rotation was successful.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.rotate)
---@param param?LuaEntity.rotate_param
---@return boolean@Whether the rotation was successful.
---@return {[string]: uint}?@Count of spilled items indexed by their prototype names if `spill_items` was `true`.
rotate=function(param)end,
---Set the source of this beam.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_beam_source)
---
---_Can only be used if this is Beam_
---@param source LuaEntity|MapPosition
set_beam_source=function(source)end,
---Set the target of this beam.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_beam_target)
---
---_Can only be used if this is Beam_
---@param target LuaEntity|MapPosition
set_beam_target=function(target)end,
---Give the entity a command.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_command)
---
---_Can only be used if this is Unit_
---@param command Command
set_command=function(command)end,
---Give the entity a distraction command.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_distraction_command)
---
---_Can only be used if this is Unit_
---@param command Command
set_distraction_command=function(command)end,
---Sets the driver of this vehicle.
---
---**Note:** This differs over [LuaEntity::set_passenger](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger) in that the passenger can't drive the vehicle.
---
---**Events:**
--- * May raise [on_player_driving_changed_state](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) instantly.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_driver)
---
---_Can only be used if this is Vehicle_
---@param driver LuaEntity|PlayerIdentification@The new driver or `nil` to eject the current driver if any.
set_driver=function(driver)end,
---Set the filter for a slot in an inserter, loader, or logistic storage container.
---
---**Note:** The entity must allow filters.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_filter)
---@param slot_index uint@Index of the slot to set the filter for.
---@param item string@Prototype name of the item to filter.
set_filter=function(slot_index,item)end,
---Sets the heat setting for this heat interface.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_heat_setting)
---
---_Can only be used if this is HeatInterface_
---@param filter HeatSetting@The new setting.
set_heat_setting=function(filter)end,
---Sets the filter for this infinity container at the given index.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_infinity_container_filter)
---
---_Can only be used if this is InfinityContainer_
---@param index uint@The index to set.
---@param filter InfinityInventoryFilter@The new filter or `nil` to clear the filter.
set_infinity_container_filter=function(index,filter)end,
---Sets the filter for this infinity pipe.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_infinity_pipe_filter)
---
---_Can only be used if this is InfinityPipe_
---@param filter InfinityPipeFilter@The new filter or `nil` to clear the filter.
set_infinity_pipe_filter=function(filter)end,
---Sets the passenger of this car or spidertron.
---
---**Note:** This differs over [LuaEntity::get_driver](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_driver) in that the passenger can't drive the car.
---
---**Events:**
--- * May raise [on_player_driving_changed_state](https://lua-api.factorio.com/latest/events.html#on_player_driving_changed_state) instantly.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger)
---
---_Can only be used if this is Vehicle_
---@param passenger LuaEntity|PlayerIdentification
set_passenger=function(passenger)end,
---Sets the current recipe in this assembly machine.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_recipe)
---
---_Can only be used if this is AssemblingMachine_
---@param recipe string|LuaRecipe@The new recipe or `nil` to clear the recipe.
---@return {[string]: uint}@Any items removed from this entity as a result of setting the recipe.
set_recipe=function(recipe)end,
---Set a logistic requester slot.
---
---**Note:** Useable only on entities that have requester slots.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_request_slot)
---@param request ItemStackIdentification@What to request.
---@param slot uint@The slot index.
---@return boolean@Whether the slot was set.
set_request_slot=function(request,slot)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive)
---@class LuaEntity.silent_revive_param
---If `true` the function will return item request proxy as the third parameter.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive)
---@field return_item_request_proxy? boolean
---If true, and an entity ghost; [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) will be called. Else if true, and a tile ghost; [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) will be called.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive)
---@field raise_revive? boolean
---Revives a ghost silently.
---
---**Events:**
--- * May raise [script_raised_revive](https://lua-api.factorio.com/latest/events.html#script_raised_revive) instantly.
---Raised if this was an entity ghost and the `raise_revive` flag was set and the entity was successfully revived.
---
--- * May raise [script_raised_set_tiles](https://lua-api.factorio.com/latest/events.html#script_raised_set_tiles) instantly.
---Raised if this was a tile ghost and the `raise_revive` flag was set and the tile was successfully revived.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.silent_revive)
---@param param?LuaEntity.silent_revive_param
---@return {[string]: uint}?@Any items the new real entity collided with or `nil` if the ghost could not be revived.
---@return LuaEntity?@The revived entity if an entity ghost was successfully revived.
---@return LuaEntity?@The item request proxy if it was requested with `return_item_request_proxy`.
silent_revive=function(param)end,
---Triggers spawn_decoration actions defined in the entity prototype or does nothing if entity is not "turret" or "unit-spawner".
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.spawn_decorations)
spawn_decorations=function()end,
---Only works if the entity is a speech-bubble, with an "effect" defined in its wrapper_flow_style. Starts animating the opacity of the speech bubble towards zero, and destroys the entity when it hits zero.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.start_fading_out)
start_fading_out=function()end,
---Stops the given SpiderVehicle.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stop_spider)
---
---_Can only be used if this is SpiderVehicle_
stop_spider=function()end,
---Whether this entity supports a backer name.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.supports_backer_name)
---@return boolean
supports_backer_name=function()end,
---Is this entity marked for deconstruction?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_deconstructed)
---@return boolean
to_be_deconstructed=function()end,
---Is this entity marked for upgrade?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.to_be_upgraded)
---@return boolean
to_be_upgraded=function()end,
---Toggle this entity's equipment movement bonus. Does nothing if the entity does not have an equipment grid.
---
---**Note:** This property can also be read and written on the equipment grid of this entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.toggle_equipment_movement_bonus)
toggle_equipment_movement_bonus=function()end,
---Reconnect loader, beacon, cliff and mining drill connections to entities that might have been teleported out or in by the script. The game doesn't do this automatically as we don't want to loose performance by checking this in normal games.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.update_connections)
update_connections=function()end,
}