Skip to content
Back to top
View this page

# `characters`

Module with structures to process data about characters persisted to Terraria worlds, out of which the main one is `WorldCharacters`.

## `world_characters`

Submodule containing `WorldCharacters`.

class lihzahrd.terraria.world.characters.world_characters.WorldCharacters(*args: Pack)

  Bases: `PackComposite`

  `PackComposite` containing information about the characters present in the Terraria world.

  For some reason, shimmer status of the town NPCs is saved in a separate array than the rest of the NPC data.

## `world_npcs_collection`

class lihzahrd.terraria.world.characters.world_npcs_collection.WorldNPCCollection(items: list[Item])

  Bases: `PackFlagArray`[`WorldNPC`]

  `PackFlagArray` of all the NPCs in a Terraria world.

  ITEM

    alias of `WorldNPC`

## `world_npc`

class lihzahrd.terraria.world.characters.world_npc.WorldNPC(value: Value)

  Bases: `PackPrimitive`[`NPCBase`]

  `lihzahrd.terraria.utils.pack.primitive.primitive.PackPrimitive` to process a NPC stores in a Terraria world.

  exception MissingVariationIndexError(value: Value)

    Bases: `ValidationError`

    `NPCData.is_town_npc` is set, but `NPCData.variation_index` isn’t.

## `world_enemies_collection`

class lihzahrd.terraria.world.characters.world_enemies_collection.WorldEnemiesCollection(items: list[Item])

  Bases: `PackFlagArray`[`WorldEnemy`]

  `PackFlagArray` of all the mobs in a Terraria world.

  ITEM

    alias of `WorldEnemy`

## `world_enemy`

class lihzahrd.terraria.world.characters.world_enemy.WorldEnemy(value: Value)

  Bases: `PackPrimitive`[`WorldEnemyData`]

  `PackPrimitive` to process a single persisted enemy in a Terraria world.

  Tip

  Enemies are usually persisted when they hold the player’s dropped coins in Expert difficulty!

## `world_enemy_data`

class lihzahrd.terraria.world.characters.world_enemy_data.WorldEnemyData(kind: int, position: Coordinates[float])

  Data about an enemy in a Terraria world.

  kind: int

    The kind of enemy represented by this data.

  position: Coordinates[float]

    The position of the enemy.

## `world_shimmered_npcs_collection`

class lihzahrd.terraria.world.characters.world_shimmered_npcs_collection.WorldShimmeredNPCsCollection(items: list[Item])

  Bases: `PackCountArray`[`PackInt`]

  `PackCountArray` of NPC IDs that are in their shimmered form.

  ITEM

    alias of `PackInt`