Options
All
  • Public
  • Public/Protected
  • All
Menu

Item animations are used to display items or blocks models in the world

Hierarchy

Index

Constructors

  • new Item(x: number, y: number, z: number): Item

Methods

  • createRenderIfNeeded(): void
  • describe(description: { material?: string; mesh?: RenderMesh; render?: number; scale?: number; skin?: string }): void
  • Describes animation parameters for the future use. Call load or loadCustom to actually launch the animation

    Parameters

    • description: { material?: string; mesh?: RenderMesh; render?: number; scale?: number; skin?: string }

      an object containing all the required data about animation

      • Optional material?: string

        Animation material, can be used to apply custom materials to the animation

      • Optional mesh?: RenderMesh

        RenderMesh object to be displayed with animation

      • Optional render?: number

        Numeric id of the Render object to be displayed with animation. Can be obtained using Render.getId

      • Optional scale?: number

        Animation scale, default is 1

      • Optional skin?: string

        Name of the texture to be used as render's skin

    Returns void

  • describeItem(item: { count?: number; data?: number; extra?: ItemExtraData; glint?: boolean; id: number; material?: string; notRandomize?: boolean; rotation?: string | [number, number, number]; size?: number; skin?: string }): void
  • Describes item to be used for the animation

    Parameters

    • item: { count?: number; data?: number; extra?: ItemExtraData; glint?: boolean; id: number; material?: string; notRandomize?: boolean; rotation?: string | [number, number, number]; size?: number; skin?: string }

      item parameters object

      • Optional count?: number

        Item count, will be transform to display an appropriate animation

      • Optional data?: number

        Item data

      • Optional extra?: ItemExtraData

        Item extra

      • Optional glint?: boolean

        Whether the item should be in glint state or not

      • id: number

        Item id

      • Optional material?: string

        Shader material name

      • Optional notRandomize?: boolean

        If true, the position of the item will not be randomized

      • Optional rotation?: string | [number, number, number]

        If string "x" is passed, the item is rotated 90 along x axis, if "z" is passed, the item is rotated 90 along z axis, otherwise the item is rotated according to the rotation array along all the three axes

      • Optional size?: number

        Item/block size, default is 0.5

      • Optional skin?: string

        Skin name to be used for the render. If no skin is passed, default item skin is used

    Returns void

  • describeItemAlternative(item: any, offset: any): void
  • describeItemDefault(item: any): void
  • destroy(): void
  • getAge(): void
  • getRenderAPI(base: any): any
  • load(): void
  • loadCustom(func: (() => void)): void
  • newTransform(transformations: { name: string; params: any[] }[], noClear: boolean): void
  • Creates a set of transformations for the current animation

    Parameters

    • transformations: { name: string; params: any[] }[]
    • noClear: boolean

    Returns void

  • refresh(): void
  • resetBlockLightPos(): void
  • resetTransform(): void
  • setBlockLightPos(x: number, y: number, z: number): void
  • Sets specified coordinates as light measuring position for the animation. In other words, animation lightning will be calculated as if animation was at the specified coordinates

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • setBlocklightMode(): void
  • setIgnoreBlocklight(ignore: boolean): void
  • setIgnoreLightMode(): void
  • setInterpolationEnabled(enabled: boolean): void
  • setItemRotation(x: number, y: number, z: number): void
  • Specifies item rotation along the three axes

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • setItemSize(size: number): void
  • Specifies item size, default value is 0.5

    Parameters

    • size: number

    Returns void

  • setItemSizeAndRotation(size: number, x: number, y: number, z: number): void
  • Specifies item size and rotation via single function call

    Parameters

    • size: number
    • x: number
    • y: number
    • z: number

    Returns void

  • setPos(x: number, y: number, z: number): void
  • setSkylightMode(): void
  • updateRender(): void

Generated using TypeDoc