Перейти к основному содержанию

Render

Class that is used to give mobs, animations and blocks custom shape.

Index

Constructors

constructor

  • Creates a new Render instance with specified parameters.


    Parameters

    • optionalparameters: string | number | RenderParameters

      specifies all the properties of the object. If it is a number, vanilla render ID is used, if it is a string, used as RenderParameters.name name property

    Returns Render

Properties

readonlyisChangeable

isChangeable: boolean

readonlyisEmpty

isEmpty: boolean

readonlymodel

model: Model

readonlyparts
internal

parts: {}

Type declaration

readonlyrenderId

renderId: number

readonlyrenderer

renderer: Renderer

Methods

_setPartRecursive

addPart

  • Adds a part to the render by it's full name. The part should be descendent of one of the six default parts, see ModelPart for details.


    Parameters

    • partName: string

      full name of the part separated by "."

    • optionalpartParams: PartParameters

      specifies all the parameters of the part

    Returns ModelPart

    Newly created part.

checkChangeable

  • checkChangeable(): void
  • Returns void

fromCache

  • fromCache(data: Cache): void
  • @deprecated

    Unavailable feature, renderers must be saved independently.


    Parameters

    Returns void

getID

  • getID(): number

  • Returns number

    Render identifier that can be used to set render to the mob, animation or block.

getId

  • getId(): number

  • Returns number

    Render identifier that can be used to set render to the mob, animation or block.

getModel


  • Returns Model

    Render's model that defines it's visual shape.

getPart


  • Parameters

    • partName: string

      full name of the part separated by "."

    Returns ModelPart

    A part of the render by it's full name. By default, there are six parts available to the user. However, you can create your own parts that suit your needs and get them by their names.

getRenderType

  • getRenderType(): number

  • Returns number

    Render identifier that can be used to set render to the mob, animation or block.

init

  • Specifies additional params for the following Render.


    Parameters

    • optionalparams: string | number | RenderParameters

      specifies all the properties of the object. If it is a number, vanilla render ID is used, if it is a string, used as RenderParameters.name name property

    Returns void

initModel

  • initModel(): void
  • Returns void

loadInitialState

  • loadInitialState(name: string): void
  • @deprecated

    Unavailable feature, renderers must be saved independently.


    Parameters

    • name: string

    Returns void

loadState

  • loadState(name: string, isLocal: boolean): void
  • @deprecated

    Unavailable feature, renderers must be saved independently.


    Parameters

    • name: string
    • isLocal: boolean

    Returns void

rebuild

  • rebuild(): void
  • Returns void

saveState

  • saveState(name: string, isLocal: boolean): void
  • @deprecated

    Unavailable feature, renderers must be saved independently.


    Parameters

    • name: string
    • isLocal: boolean

    Returns void

saveToNext

  • saveToNext(name: string, isLocal: boolean): void
  • @deprecated

    Unavailable feature, renderers must be saved independently.


    Parameters

    • name: string
    • isLocal: boolean

    Returns void

setPart

  • Sets the content and all properties of the part by it's full name.


    Parameters

    • name: string

      full name of the part separated by "."

    • data: PartElement[]

      array of part data objects to be applied to the part

    • params: PartParameters

      specifies all the parameters of the part

    Returns void

setPartParams

  • Sets all the properties of the part by it's full name.


    Parameters

    • partName: string

      full name of the part separated by "."

    • optionalpartParams: PartParameters

      specifies all the parameters of the part

    Returns void

setTextureResolution

  • setTextureResolution(...params: any): void
  • @deprecated

    Does nothing, not required anymore.


    Parameters

    • rest...params: any

    Returns void

toCache

  • @deprecated

    Unavailable feature, renderers must be saved independently.


    Returns Cache

transform


  • Returns Transform

    Transform object used to manipulate current render.