entity

Entity alias module. Imports the base-class Entity, as well as all the prototypes in draftsman.prototypes.

new_entity(name: str, **kwargs) Entity

Factory function for creating a new Entity. The class used will be based on the entity’s name, so new_entity("wooden-chest") will return a Container instance. Useful if you know the name of the Entity you want to make, but don’t know what type it is.

Any additional keyword arguments are passed to the entity’s constructor, allowing you to specify the entity’s position, ID, or any other relevant information during construction.

Raises DraftsmanWarning if any keyword passed in is not recognized by that Entity’s class constructor.

Parameters:
name: str

The string name of an Entity.

**kwargs

A dict of all the keyword arguments to pass to the constructor.

Returns:

A new instance of a Entity subclass, or an instance of Entity if name could not be deduced under the current Factorio environment.