bedrock-kit
    Preparing search index...

    Class TextureAtlasFile

    Wraps a texture atlas JSON file — either textures/item_texture.json or textures/terrain_texture.json. Maps shortnames to texture file paths.

    Accessed via addon.itemTextures and addon.terrainTextures.

    addon.itemTextures?.get("iron_sword");    // "textures/items/iron_sword"
    addon.terrainTextures?.get("dirt"); // "textures/blocks/dirt"
    addon.terrainTextures?.get("grass_side"); // ["textures/blocks/grass_side", ...]

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    data: Record<string, unknown>

    The raw parsed JSON data of the asset file.

    docstrings: CommentBlock[]

    All JSDoc-style comment blocks parsed from this asset's source file, in document order. Empty array when no /** … */ blocks are present.

    filePath: string

    Absolute path to the asset's file on disk. Empty string in browser mode.

    resourcePackName: string

    The resource pack name declared in the file, e.g. "vanilla".

    textureName: string

    The texture name declared in the file, e.g. "item_texture".

    Accessors

    • get shortnames(): string[]

      Returns all shortnames defined in this atlas.

      Returns string[]

    Methods

    • Returns the texture path(s) for a shortname, or undefined if not found. When multiple frames are defined (animated textures), returns a string[].

      Parameters

      • shortname: string

      Returns string | string[]

      atlas.get("dirt")        // "textures/blocks/dirt"
      atlas.get("fire_0") // ["textures/blocks/fire_0_0", "textures/blocks/fire_0_1"]
      atlas.get("nonexistent") // undefined