entity

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

new_entity(name: str, **kwargs: dict) 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 – The string name of an Entity.

  • kwargs – A dict of all the keyword arguments to pass to the constructor.

Raises:

InvalidEntityID – If the name passed in is not recognized as any valid entity name.