Skip to content
Back to top
View this page

# `tile_entities`

Module with structures to process data about tile entities in to Terraria worlds, out of which the main one is `TileEntitiesCollection`.

## `tile_entities_collection`

Submodule containing `TileEntitiesCollection`.

class lihzahrd.terraria.world.tile_entities.tile_entities_collection.TileEntitiesCollection(items: list[Item])

  `PackCountArray` of all the tile entities (item frames, mannequins, etc.) in a Terraria world.

  ITEM

    alias of `TileEntity`

## `tile_entity`

Submodule containing `TileEntity`.

class lihzahrd.terraria.world.tile_entities.tile_entity.TileEntity(value: Value)

  Data about a single tile entity (item frame, mannequin, etc.) placed in a Terraria world.

  exception UnknownTileEntityError(kind: int)

    The tile entity could not be processed because its kind is unknown.

    If this happens, there’s no way to determine the shape that extras

## `tile_entity_data`

Submodule containing `TileEntityData`.

class lihzahrd.terraria.world.tile_entities.tile_entity_data.TileEntityData(id: int, position: Coordinates[int], extra: TileEntityExtra)

  Data about any tile entity.

  The kind of entity that this class represents is given by the specific class of the value of the `extra` parameter.

  id: int

    Unknown.

  position: Coordinates[int]

    The position of the tile entity in world coordinates.

  extra: TileEntityExtra

    Extra data about the tile entity. The kind of tile entity is determined by the class of this value.

    Todo

    A better, more extensible way to implement this would be via a ClassEnum and inheritance, as that would allow new kinds of tile entities to be registered without having to edit `lihzahrd`.

  kind() → int
    Returns:

      The kind ID of the tile entity, as determined by the `TileEntityExtra.tile_entity_kind()` of the `extra` parameter.

## `tile_entity_extra`

Submodule containing `TileEntityExtra`.

class lihzahrd.terraria.world.tile_entities.tile_entity_extra.TileEntityExtra

  Base class for tile entity extra data.

  abstractmethod static tile_entity_kind() → int
    Returns:

      The kind id of the associated tile entity.

## `target_dummy_extra`

Submodule containing `TargetDummyExtra`.

class lihzahrd.terraria.world.tile_entities.target_dummy_extra.TargetDummyExtra(character_index: int)

  Extra data about a `TargetDummy`.

## `item_frame_extra`

Submodule containing `ItemFrameExtra`.

class lihzahrd.terraria.world.tile_entities.item_frame_extra.ItemFrameExtra(item: ItemBase)

  Extra data about an `ItemFrame`.

  item: ItemBase

    The contained item.

## `logic_sensor_extra`

Submodule containing `LogicSensorExtra`.

class lihzahrd.terraria.world.tile_entities.logic_sensor_extra.LogicSensorExtra(kind: int, enabled: bool)

  Extra data about a logic sensor, like `LogicGateAND`.

  kind: int

    The kind of logic sensor.

  enabled: bool

    Whether the logic sensor is currently on or off.

## `mannequin_extra`

Submodule containing `MannequinExtra`.

class lihzahrd.terraria.world.tile_entities.mannequin_extra.MannequinExtra(pose: int, helmet: DyedStackData, shirt: DyedStackData, pants: DyedStackData, accessory_1: DyedStackData, accessory_2: DyedStackData, accessory_3: DyedStackData, accessory_4: DyedStackData, accessory_5: DyedStackData, mount: DyedStackData, weapon: ItemBase | None)

  Extra data about a `Mannequin` or a `Womannequin`.

  pose: int

    The pose the mannequin is in.

    Todo

    Determine and validate which kinds of poses exist.

  helmet: DyedStackData

    The helmet slot.

  shirt: DyedStackData

    The shirt slot.

  pants: DyedStackData

    The pants slot.

  accessory_1: DyedStackData

    The first accessory slot.

  accessory_2: DyedStackData

    The second accessory slot.

  accessory_3: DyedStackData

    The third accessory slot.

  accessory_4: DyedStackData

    The fourth accessory slot.

  accessory_5: DyedStackData

    The fifth accessory slot.

  mount: DyedStackData

    The mount slot.

  weapon: ItemBase | None

    The weapon slot.

## `dyed_stack_data`

Submodule containing `DyedStackData`.

class lihzahrd.terraria.world.tile_entities.dyed_stack_data.DyedStackData(item: ItemBase | None, dye: ItemBase | None)

  Data about an item with a dye applied to it.

  Used in mannequins and weapon racks.

  item: ItemBase | None

    The item slot.

  dye: ItemBase | None

    The dye slot.

## `weapon_rack_extra`

Submodule containing `WeaponRackExtra`.

class lihzahrd.terraria.world.tile_entities.weapon_rack_extra.WeaponRackExtra(item: ItemBase)

  Extra data about a `WeaponRack`.

  item: ItemBase

    The stored item.

## `hat_rack_extra`

Submodule containing `HatRackExtra`.

class lihzahrd.terraria.world.tile_entities.hat_rack_extra.HatRackExtra(left: DyedStackData, right: DyedStackData)

  Extra data about a `HatRack`.

  left: DyedStackData

    The hat on the left.

  right: DyedStackData

    The hat on the right.

## `food_plate_extra`

Submodule containing `FoodPlateExtra`.

class lihzahrd.terraria.world.tile_entities.food_plate_extra.FoodPlateExtra(item: ItemBase)

  Extra data about a `Plate`.

  item: ItemBase

    The stored item.

## `pylon_extra`

Submodule containing `PylonExtra`.

class lihzahrd.terraria.world.tile_entities.pylon_extra.PylonExtra

  Extra data about a Pylon.

## `item_flask_extra`

Submodule containing `ItemFlaskExtra`.

class lihzahrd.terraria.world.tile_entities.item_flask_extra.ItemFlaskExtra(item: ItemBase)

  Extra data about a `DeadCellsDisplayJar`.

  item: ItemBase

    The stored item.

## `kite_extra`

Submodule containing `KiteExtra`.

class lihzahrd.terraria.world.tile_entities.kite_extra.KiteExtra(kind: int)

  Extra data about a placed and anchored kite.

  kind: int

    The ID of the placed kite.