Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Item

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

Hierarchy

Index

Constructors

constructor

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

Methods

createRenderIfNeeded

  • createRenderIfNeeded(): void

describe

  • describe(description: { material?: string; mesh?: RenderMesh; render?: Render; 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?: Render; 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?: Render

        Render object to be displayed with animation

      • 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

  • 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

  • describeItemAlternative(item: any, offset: any): void

describeItemDefault

  • describeItemDefault(item: any): void

destroy

  • destroy(): void

getAge

  • getAge(): void

getRenderAPI

  • getRenderAPI(base: any): any

getShaderUniforms

load

  • load(): void

loadCustom

  • loadCustom(func: () => void): void

newTransform

  • 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

  • refresh(): void

resetBlockLightPos

  • resetBlockLightPos(): void

resetTransform

  • resetTransform(): void

setBlockLightPos

  • 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

  • setBlocklightMode(): void

setIgnoreBlocklight

  • setIgnoreBlocklight(ignore: boolean): void

setIgnoreLightMode

  • setIgnoreLightMode(): void

setInterpolationEnabled

  • setInterpolationEnabled(enabled: boolean): void

setItemRotation

  • 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

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

    Parameters

    • size: number

    Returns void

setItemSizeAndRotation

  • 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

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

setSkylightMode

  • setSkylightMode(): void
  • Sets light measuring position to always match day/night lightning, even when the animation is not directly illuminated

    Returns void

transform

updateRender

  • updateRender(): void

Generated using TypeDoc