Skip to content
Back to top
View this page

# `classmembers`

Submodule for ClassMember and ClassMemberBase.

## Bases

### `block_base`

Submodule for `BlockBase`.

class lihzahrd.terraria.data.classmembers.block_base.BlockBase(*, frame: tuple[int, int] | None = None, shape: BlockShapeEnum = BlockShapeEnum.NORMAL, is_inactive: bool = False, paint: PaintEnum = PaintEnum.NONE, is_illuminant: bool = False, is_echo: bool = False)

  The kind of Terraria block.

  All blocks inherit from this; it’s a ClassMemberBase for members of `BlockEnum`.

  It:

  - annotates the mandatory attributes that all blocks should have.

  - implements the `FrameImportantVariant` system for the ClassInstance.

  Parameters:

    - frame – The `uv` sprite coordinates of this block’s current animation frame, or `None` if the block is not frame important.

    - shape – The shape the block has. Defaults to `BlockShapeEnum.NORMAL`, which is the full block.

    - is_inactive – Whether the block has been deactivated by an actuator or not.

    - paint – The paint that is applied to the block, or `None` if no paint is applied.

    - is_illuminant – Whether the block has had Illuminant Coating applied to it and is therefore always full bright.

    - is_echo – Whether the block has had Echo Coating applied to it and is therefore invisible.

  ID: int

    The ID of the tile.

  NAME: str

    The default name of the ClassMember.

  COLOR: ColorRGB | None = None

    The default color of the ClassMember.

  SOLID: bool = False

    The default solidity of the ClassMember.

  BLEND: bool = True

    Unknown.

  MERGE: bool = True

    Unknown.

  TRANSPARENT: bool = False

    The default transparency (lets light through) of the ClassMember.

  IS_STONE: bool = False

    The default stone-ness of the ClassMember.

  IS_GRASS: bool = False

    The default grass-ness of the ClassMember.

  EMIT_LIGHT_COLOR: ColorRGB | None = None

    The default color of the light emitted by the ClassMember, if any.

  FRAMEIMPORTANT_VARIANTS: tuple[FrameImportantVariant, ...]

    Ordered `tuple` of all `FrameImportantVariant` potentially applying to this tile, from the first to be tested, to the last.

  shape: BlockShapeEnum

    The shape the block has.

  is_inactive: bool

    Whether the block has been deactivated by an actuator or not.

  paint: PaintEnum

    The paint that is applied to the block.

  is_illuminant: bool

    Whether the block has had Illuminant Coating applied to it and is therefore always full bright.

  is_echo: bool

    Whether the block has had Echo Coating applied to it and is therefore invisible.

  property frame: tuple[int, int] | None
    Returns:

      The `uv` sprite coordinates of this block’s current animation frame, or `None` if the block is not frame important.

  property u: int | None

    The `u` sprite coordinate of this block’s current animation frame, or `None` if the block is not frame important.

  property v: int | None

    The `v` sprite coordinate of this block’s current animation frame, or `None` if the block is not frame important.

  is_frameimportant() → bool
    Returns:

      Whether this ClassInstance is FrameImportant, determined by whether `_u` and `_v` are set.

  name() → str
    Returns:

      The name of this ClassInstance.

  color() → ColorRGB | None
    Returns:

      The color of this ClassInstance.

  solid() → bool
    Returns:

      The solidity of this ClassInstance.

  transparent() → bool
    Returns:

      The transparency (lets light through) of the ClassInstance.

  is_stone() → bool
    Returns:

      The stone-ness of the ClassInstance.

  is_grass() → bool
    Returns:

      The grass-ness of the ClassInstance.

  emit_light_color() → ColorRGB | None
    Returns:

      The color of the light emitted by the ClassInstance, if any.

### `wall_base`

Submodule for `WallBase`.

class lihzahrd.terraria.data.classmembers.wall_base.WallBase(paint: PaintEnum = None, is_illuminant: bool = False, is_echo: bool = False)

  The kind of Terraria wall.

  All walls inherit from this; it’s a ClassMemberBase for members of `WallEnum`.

  It:

  - annotates the mandatory attributes that all walls should have.

  Parameters:

    - paint – The paint that is applied to the wall, or `None` if no paint is applied.

    - is_illuminant – Whether the wall has had Illuminant Coating applied to it and is therefore always full bright.

    - is_echo – Whether the wall has had Echo Coating applied to it and is therefore invisible.

  ID: int

    The ID of the prefix.

  NAME: str

    The prefix.

  COLOR: ColorRGB | None = None

    The default color of the ClassMember.

  BLEND: int

    Unknown.

  paint: PaintEnum

    The paint covering the wall.

  is_illuminant: bool

    Whether the wall has had Illuminant Coating applied to it.

  is_echo: bool

    Whether the wall has had Echo Coating applied to it.

### `item_base`

Submodule for `ItemBase`.

class lihzahrd.terraria.data.classmembers.item_base.ItemBase(quantity: int = 1, prefix: type[PrefixBase] | None = None)

  The kind of Terraria item.

  All items inherit from this; it’s a ClassMemberBase for members of `ItemEnum`.

  It:

  - annotates the mandatory attributes that all items should have.

  - defines the `__init__()` method to create a ClassInstance.

  Parameters:

    - quantity – The amount of items in the stack.

    - prefix – The prefix of the items in the stack.

  ID: int

    The ID of the item.

  NAME: str

    The name of the item.

  quantity: int

    The amount of items in the stack.

  prefix: type[PrefixBase] | None

    The prefix of the items in the stack.

### `npc_base`

Submodule for `NPCBase`.

class lihzahrd.terraria.data.classmembers.npc_base.NPCBase(name: str, position: Coordinates[float], is_homeless: bool, home: Coordinates[int], is_town_npc: bool, flag_1: bool, flag_2: bool, flag_3: bool, flag_4: bool, flag_5: bool, flag_6: bool, flag_7: bool, variation_index: int | None, homeless_despawn: bool)

  The kind of Terraria NPC.

  All NPCs inherit from this; it’s a ClassMemberBase for members of `NPCEnum`.

  It:

  - annotates the mandatory attributes that all NPCs should have.

  ID: int

    The ID of the NPC.

  JOB: str

    The job name of the NPC.

  name: str

    The name of the NPC.

  position: Coordinates[float]

    The current position of the NPC.

  is_homeless: bool

    Whether this NPC has a home or not.

  home: Coordinates[int]

    The position of the last home of the NPC.

  is_town_npc: bool

    Unknown. Determines whether `variation_index` is saved for this NPC.

  flag_1: bool

    Currently unused.

  flag_2: bool

    Currently unused.

  flag_3: bool

    Currently unused.

  flag_4: bool

    Currently unused.

  flag_5: bool

    Currently unused.

  flag_6: bool

    Currently unused.

  flag_7: bool

    Currently unused.

  variation_index: int | None

    Unknown.

  homeless_despawn: bool

    Unknown.

### `prefix_base`

Submodule for `PrefixBase`.

class lihzahrd.terraria.data.classmembers.prefix_base.PrefixBase

  The prefix.

  All prefixes inherit from this one; it’s a ClassMemberBase for members of `PrefixEnum`.

  It:

  - annotates the mandatory attributes that all prefixes should have.

  Raises:

    NotImplementedError – If attempted to instantiate.

  ID: int

    The ID of the prefix.

  NAME: str

    The prefix.

### `liquid_base`

Submodule for `LiquidBase`.

class lihzahrd.terraria.data.classmembers.liquid_base.LiquidBase(volume: int)

  The kind of Terraria liquid.

  All liquid inherit from this; it’s a ClassMemberBase for members of `LiquidEnum`.

  It:

  - annotates the mandatory attributes that all liquids should have.

  Parameters:

    volume – The volume of the liquid.

  ID: int

    The ID of the prefix.

  NAME: str

    The prefix.

  COLOR: ColorRGB | None = None

    The default color of the ClassMember.

  volume: int

    The volume of the liquid.

## Members

### `blocks`

Module for ClassMember of `BlockEnum`.

Note

This module was partially generated by `lihzahrd._generate.terraria.tiles_generator.TilesGenerator`.

Note

For brevity, only a single ClassMember is documented, as an example.

class lihzahrd.terraria.data.classmembers.blocks.Torch(*, frame: tuple[int, int] | None = None, shape: BlockShapeEnum = BlockShapeEnum.NORMAL, is_inactive: bool = False, paint: PaintEnum = PaintEnum.NONE, is_illuminant: bool = False, is_echo: bool = False)

  A Torch.

  It is FrameImportant:

  - Depending on its `u` value, the torch can be on or off.

  - Depending on its `v` value, the torch is one of the multiple variants existing in Terraria.

### `items`

Module for ClassMember of `ItemEnum`.

Note

This module was partially generated by `lihzahrd._generate.terraria.tiles_generator.TilesGenerator`.

Note

For brevity, only a single ClassMember is documented, as an example.

class lihzahrd.terraria.data.classmembers.items.Gel(quantity: int = 1, prefix: type[PrefixBase] | None = None)

  Gel, dropped by slimes.

### `npcs`

Module for ClassMember of `NPCEnum`.

Note

This module was partially generated by `lihzahrd._generate.terraria.tiles_generator.TilesGenerator`.

Note

For brevity, only a single ClassMember is documented, as an example.

class lihzahrd.terraria.data.classmembers.npcs.Merchant(name: str, position: Coordinates[float], is_homeless: bool, home: Coordinates[int], is_town_npc: bool, flag_1: bool, flag_2: bool, flag_3: bool, flag_4: bool, flag_5: bool, flag_6: bool, flag_7: bool, variation_index: int | None, homeless_despawn: bool)

  The Merchant.

### `prefixes`

Module for ClassMember of `PrefixEnum`.

Note

This module was partially generated by `lihzahrd._generate.terraria.tiles_generator.TilesGenerator`.

Note

For brevity, only a single ClassMember is documented, as an example.

class lihzahrd.terraria.data.classmembers.prefixes.Large

  The Large modifier.

  It:

  - increases the size of the affected weapon by 12%

  - increases the tier of the affected item by 1

  - increases the value of the affected item by 25.44%

### `walls`

Module for ClassMember of `WallEnum`.

Note

This module was partially generated by `lihzahrd._generate.terraria.tiles_generator.TilesGenerator`.

Note

For brevity, only a single ClassMember is documented, as an example.

class lihzahrd.terraria.data.classmembers.walls.StoneWall(paint: PaintEnum = None, is_illuminant: bool = False, is_echo: bool = False)

  A Stone Wall.

### `liquids`

Module for ClassMember of `LiquidEnum`.

class lihzahrd.terraria.data.classmembers.liquids.Water

  Water.

class lihzahrd.terraria.data.classmembers.liquids.Lava

  Lava.

class lihzahrd.terraria.data.classmembers.liquids.Honey

  Honey.

class lihzahrd.terraria.data.classmembers.liquids.Shimmer

  Shimmer.