modules

class ModulesMixin

Allows the entity to have modules, and keep track of the amount of modules currently inside the entity.

property allowed_effects : set[str] | None

A set of all effect modifiers that this entity supports via modules and beacons. Returns None if this entity’s name is not recognized by Draftsman.

property allowed_modules : set[str] | None

A list of all valid modules that can be inserted into this entity. Determined by the ‘allowed_effects’ key in the data.raw entry for this entity. Returns None if this entity’s name is not recognized by Draftsman.

abstract property module_slots_occupied : int

The total number of module slots that are currently taken by inserted modules. Returns 0 if unable to determine.

property total_module_slots : int

The total number of module slots the Entity can hold. Returns None if this entity’s name is not recognized by Draftsman.

request_modules(
inventory_id: InventoryType,
module_name: str,
slots: int | Iterable[int],
quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' = 'normal',
)

Loads module module_name into the slot specified by slots, or multiple slots if slots is instead an iterable of integers.

Parameters:
module_name: str

The name of the module to request to this entity.

slots: int | Iterable[int]

The slots to request this module to.

quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' = 'normal'

The quality of the module to request.