This wiki is about 0.17, the current experimental version of Factorio.

Information about 0.16, the current stable version of Factorio, can be found on


From Official Factorio Wiki
Jump to: navigation, search

Prototype definitions » PrototypeBase » Prototype/Entity

Abstract base of all entities in the game. Entity is basically everything that can be on the map (except tiles). For in game script access to entity, take a look at LuaEntity

Prototype/Entity — abstract
icons, icon, icon_size (IconSpecification)::IconSpecification
additional_pastable_entities::string or table of string (optional)
alert_icon_scale::float (optional)
alert_icon_shift::vector (optional)
allow_copy_paste::bool (optional)
autoplace::AutoplaceSpecification (optional)
build_base_evolution_requirement::double (optional)
build_sound::Sound (optional)
close_sound::Sound (optional)
collision_box::BoundingBox (optional)
collision_mask::CollisionMask (optional)
created_effect::Trigger (optional)
created_smoke::CreateTrivialSmokeEffectItem (optional)
drawing_box::BoundingBox (optional)
emissions_per_second::double (optional)
emissions_per_tick::double (optional)
enemy_map_color::Color (optional)
fast_replaceable_group::string (optional)
flags::EntityPrototypeFlags (optional)
friendly_map_color::Color (optional)
hit_visualization_box::BoundingBox (optional)
map_color::Color (optional)
map_generator_bounding_box::BoundingBox (optional)
minable::MinableProperties (optional)
mined_sound::Sound (optional)
next_upgrade::string (optional)
open_sound::Sound (optional)
placeable_by::ItemToPlace or table of ItemToPlace (optional)
remains_when_mined::string or table of string (optional)
selectable_in_game::bool (optional)
selection_box::BoundingBox (optional)
selection_priority::uint8 (optional)
shooting_cursor_size::double (optional)
sticker_box::BoundingBox (optional)
subgroup::string (optional)
tile_height::uint32 (optional)
tile_width::uint32 (optional)
vehicle_impact_sound::Sound (optional)
working_sound::WorkingSound (optional)
Inherited from PrototypeBase
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)


Mandatory properties

Inherits all properties from PrototypeBase.


See PrototypeBase#order

Inherited from PrototypeBase. It is mandatory for entities that have at least one of these flags active: placeable-neutral, placeable-player, placeable-enemy.

icons, icon, icon_size (IconSpecification)

Type: IconSpecification
An icon is mandatory for entities that have at least one of these flags active: placeable-neutral, placeable-player, placeable-enemy.

The icon will be used in the editor building selection and the bonus gui.

icon = "__base__/graphics/icons/wooden-chest.png"

Optional properties


Type: BoundingBox
Specification of the entity collision boundaries.

Empty collision box is used for smoke, projectiles, particles, explosions etc.

collision_box = {{-0.4, -0.4}, {0.4, 0.4}}

The {0,0} coordinate in the collision box will match the entity position.

It should be near the center of the collision box, to keep correct entity drawing order. It must include the {0,0} coordinate.

Note, that for buildings, it is custom to leave 0.1 wide border between the edge of the tile and the edge of the building, this lets the player move between the building and electric poles/inserters etc.


Type: CollisionMask
Default: {"item-layer", "object-layer", "player-layer", "water-tile"}

Two entities can collide only if they share a layer from the collision mask.

NOTE: Some entity types have their own default that differs from the above default. They are listed here:


Type: BoundingBox
Default: The value of collision box.
Used instead of the collision box during map generation. Allows space entities differently during map generation, for example if the box is bigger, the entities will be placed farther apart.


Type: BoundingBox
Default: Empty = {{0, 0}, {0, 0}}
Specification of the entity selection area. When empty the entity will have no selection area (and thus is not selectable).

selection_box = {{-0.5, -0.5}, {0.5, 0.5}}

The selection box is usually a little bit bigger than the collision box, for tilable entities (like buildings) it should match the tile size of the building.


Type: BoundingBox
Default: Empty = {{0, 0}, {0, 0}} (selection_box is used instead)
Specification of space needed to see the whole entity.

This is used to calculate the correct zoom and positioning in the entity info gui.

drawing_box = {{-0.5, -0.5}, {0.5, 0.5}}


Type: BoundingBox
Default: The value of collision box.
Used to set the area of the entity that can have stickers on it, currently only used for units to specify the area where the green slow down stickers can appear. It is optional and the collision box is used when not specified.

sticker_box = {{-0.5, -0.5}, {0.5, 0.5}}


Type: BoundingBox
Default: Empty = {{0, 0}, {0, 0}}
Where beams should hit the entity. Useful if the bounding box only covers part of the entity (e.g. feet of the character) and beams only hitting there would look weird.


Type: EntityPrototypeFlags


Type: MinableProperties
Default: {minable = false, mining_time = 0}


Type: string
The name of the subgroup this entity should be sorted into in the map editor building selection.


Type: bool
Default: true


Type: bool
Default: true


Type: uint8
Default: 50
The entity with the higher number is selectable before the entity with the lower number.


Type: double
Default: 0
Amount of emissions created (positive number) or cleaned (negative number) every second by the entity. This is passive, and it is independent concept of the emissions of machines, these are created actively depending on the power consumption. Currently used just for trees.

emissions_per_second = -0.0005 -- cleaning effect of big tree


Type: double
Default: 0
#emissions_per_second, but per tick. Deprecated.


Type: double
The cursor size used when shooting at this entity.


Type: CreateTrivialSmokeEffectItem
The smoke that is shown when the entity is placed. Default is using the "smoke-building" smoke.


Type: AutoplaceSpecification
Default: nil (entity is not autoplacable)
Used to specify the rules for placing this entity during map generation.


Type: WorkingSound
Will also work on entities that don't actually do work.


Type: Trigger
The effect/trigger that happens when the entity is placed.


Type: Sound


Type: Sound


Type: Sound


Type: Sound


Type: Sound


Type: double
Default: 0


Type: vector


Type: float


Type: string
This allows you to replace an entity that's already placed, with a different one in your inventory. For example, replacing a burner drill with an electric drill.

This is simply a string, so any string can be used here. The entity that should be replaced simply has to use the same string here.

The ones the game uses are:



Type: string
Name of the entity that will be automatically selected as the upgrade of this entity when using the upgrade planner without configuration.


Type: ItemToPlace or table of ItemToPlace
Item that when placed creates this entity. Also determines which item is picked when "Q" (smart pipette) is used on the entity.


Type: string or table of string
The entity that remains when this one is mined, deconstructed or fast-replaced. The entity wont actually be spawned if it would collide with the entity that is in the process of being mined.


Type: string or table of string
Entities this entity prototype can be pasted on to in addition to the standard supported types. This is used to allow copying between types that aren't compatible on the C++ code side.


Type: uint32
Default: calculated by the collision box width rounded up.
Used to determine how the center of the entity should be positioned when building (unless the offgrid flag is specified). When the tile width is odd, the center will be in the center of the tile, when it is even, the center is on the tile transition.


Type: uint32
Default: calculated by the collision box height rounded up.


Type: Color


Type: Color


Type: Color


    type = "container",
    name = "wooden-chest",
    icon = "__base__/graphics/icons/wooden-chest.png",
    flags = {"placeable-neutral", "player-creation"},
    minable = {mining_time = 1, result = "wooden-chest"},
    max_health = 100,
    corpse = "small-remnants",
    collision_box = {{-0.35, -0.35}, {0.35, 0.35}},
    fast_replaceable_group = "container",
    selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
    inventory_size = 16,
    open_sound = { filename = "__base__/sound/wooden-chest-open.ogg" },
    close_sound = { filename = "__base__/sound/wooden-chest-close.ogg" },
    vehicle_impact_sound =  { filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0 },
    picture =
      filename = "__base__/graphics/entity/wooden-chest/wooden-chest.png",
      priority = "extra-high",
      width = 46,
      height = 33,
      shift = {0.25, 0.015625}
    circuit_wire_connection_point =
      shadow =
        red = {0.734375, 0.453125},
        green = {0.609375, 0.515625},
      wire =
        red = {0.40625, 0.21875},
        green = {0.40625, 0.375},
    circuit_connector_sprites = get_circuit_connector_sprites({0.1875, 0.15625}, nil, 18),
    circuit_wire_max_distance = 9