Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ItemModel

Class representing item model in player's hand and/or inventory. To get an instance of this class from your code, use ItemModel.getFor static function. The coordinates of the full block in player's hand or inventory is (0, 0, 0), (1, 1, 1), so it is generally recommended to use the models that fit that bound at least for the inventory

Hierarchy

  • ItemModel

Index

Properties

data: number

Item or block data current ItemModel relates to

id: number

Item or block id current ItemModel relates to

Methods

  • addToMesh(mesh: RenderMesh, x: number, y: number, z: number): void
  • getCacheKey(): string
  • getIconBitmap(): Bitmap
  • getIconBitmapNoReload(): Bitmap
  • getItemRenderMesh(count: number, randomize: boolean): RenderMesh
  • getMeshTextureName(): string
  • getUiGlintMaterialName(): string
  • getUiMaterialName(): string
  • getUiTextureName(): string
  • getWorldGlintMaterialName(): string
  • getWorldMaterialName(): string
  • getWorldTextureName(): string
  • isEmpty(): boolean
  • isEmptyInUi(): boolean
  • isEmptyInWorld(): boolean
  • isNonExistant(): boolean
  • isSpriteInUi(): boolean
  • isSpriteInWorld(): boolean
  • isUsingOverrideCallback(): boolean
  • newTexture(): Bitmap
  • overridesHand(): boolean
  • Returns boolean

    true, if this item model overrides the default model in player's hand

  • overridesUi(): boolean
  • Returns boolean

    true, if this item model overrides the default model in player's inventory

  • releaseIcon(): void
  • reloadIcon(): void
  • reloadIconIfDirty(): void
  • setCacheKey(key: string): void
  • setGlintMaterial(material: string): ItemModel
  • setHandGlintMaterial(material: string): ItemModel
  • Sets item model's material only in player's hand

    Parameters

    • texture: string

      material name to be used for the model

    Returns ItemModel

  • Sets item model's texture only in player's hand

    Parameters

    • texture: string

      texture name to be used for the model (use "atlas::terrain" for block textures)

    Returns ItemModel

  • setItemTexture(name: string, index: number): ItemModel
  • Sets item model's material in both player's inventory and in hand

    Parameters

    • texture: string

      material name to be used for the model. See {@page Materials and Shaders} for more information

    Returns ItemModel

  • setModUiSpriteBitmap(bitmap: Bitmap): ItemModel
  • setModUiSpriteName(name: string, index: number): ItemModel
  • setSpriteUiRender(isSprite: boolean): ItemModel
  • Sets item model's texture in both player's inventory and in hand

    Parameters

    • texture: string

      texture name to be used for the model (use "atlas::terrain" for block textures)

    Returns ItemModel

  • setUiGlintMaterial(material: string): ItemModel
  • Sets item model's material only in player's inventory

    Parameters

    • texture: string

      material name to be used for the model

    Returns ItemModel

  • Sets item model's texture only in player's inventory

    Parameters

    • texture: string

      texture name to be used for the model (use "atlas::terrain" for block textures)

    Returns ItemModel

Generated using TypeDoc