class DirectionalMixin(name: str, similar_entities: list[str], tile_position: list | dict = [0, 0], **kwargs: dict)

Allows the Entity to be rotated in the 4 cardinal directions. Sets the rotatable attribute to True.

property direction: Direction

The direction that the Entity is facing. An Entity’s “front” is usually the direction of it’s outputs, if it has any.

For some entities, this attribute may be redundant; for example, the direction value for an AssemblingMachine only matters if the machine has a fluid input or output.

Raises DirectionWarning if set to a diagonal direction. For 8-way rotations, ensure that the Entity inherits EightwayDirectionalMixin.


Gets the direction that the Entity is facing.


Sets the direction of the Entity. Defaults to Direction.NORTH if set to None.



  • DraftsmanError – If the direction is set while inside an Collection, which is forbidden.

  • ValueError – If set to anything other than a Direction, or its equivalent int.