Animation
Index
Classes
Base
Base animations are used to display arbitrary model in the world.
constructor
Constructs a new Base animation on the specified coordinates.
Parameters
x: number
y: number
z: number
Returns Base
createRenderIfNeeded
Creates render if it was not previously created and applies all the parameters from animation description.
Returns void
describe
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
optionalmaterial: string
Animation material, can be used to apply custom materials to the animation.
optionalmesh: RenderMesh
RenderMesh object to be displayed with animation.
optionalrender: number
Numeric ID of the Render object to be displayed with animation. Can be obtained using Render.getId
optionalscale: number = 1
Animation scale.
optionalskin: string
Name of the texture to be used as render's skin.
Returns void
destroy
Destroys animation and releases all the resources.
Returns void
exists
Returns boolean
getAge
Returns void
getShaderUniforms
Returns ShaderUniformSet
Object for current animation's render.
load
Loads animation in the world.
Returns void
loadCustom
Loads animation in the world registering it as an Updatable.
Parameters
func: () => void
function to be used as Updatable.update function
Returns void
newTransform
Creates a set of transformations for the current animation.
Parameters
transformations: { name: string; params: any[] }[]
noClear: boolean
Returns void
refresh
Refreshes the animation.
Returns void
resetBlockLightPos
Resets light measuring position for the animation (to it's coordinates).
Returns void
setBlockLightPos
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
Sets light measuring to match the animation coordinated.
Returns void
setIgnoreBlocklight
Parameters
ignore: boolean
Returns void
setIgnoreLightMode
Makes the animation ignore light at all.
Returns void
setInterpolationEnabled
Parameters
enabled: boolean
if true, animation position will be interpolated between tick calls
Returns void
setPos
Changes the animation's position.
Parameters
x: number
y: number
z: number
Returns void
setSkylightMode
Sets light measuring position to always match day/night lightning, even when the animation is not directly illuminated.
Returns void
transform
Returns Transform
Object for current animation's render.
updateRender
Refreshes the animation.
Returns void
Item
Item animations are used to display items or blocks models in the world.
constructor
Constructs a new Item animation on the specified coordinates.
Parameters
x: number
y: number
z: number
Returns Item
createRenderIfNeeded
Creates render if it was not previously created and applies all the parameters from animation description.
Returns void
describe
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
optionalmaterial: string
Animation material, can be used to apply custom materials to the animation.
optionalmesh: RenderMesh
RenderMesh object to be displayed with animation.
optionalrender: number
Numeric ID of the Render object to be displayed with animation. Can be obtained using Render.getId
optionalscale: number = 1
Animation scale.
optionalskin: string
Name of the texture to be used as render's skin.
Returns void
describeItem
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
optionalcount: number
Item count, will be transform to display an appropriate animation.
optionaldata: number
Item data.
optionalextra: ItemExtraData
Item extra.
optionalglint: boolean
Whether the item should be in glint state or not.
id: number
Item ID.
optionalmaterial: string
Shader material name.
optionalnotRandomize: boolean
If
true
, the position of the item will not be randomized.optionalrotation: 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.
optionalsize: number = 0.5
Item/block size.
optionalskin: string
Skin name to be used for the render. If no skin is passed, default item skin is used.
Returns void
describeItemDefault
Parameters
item: any
Returns void
destroy
Destroys animation and releases all the resources.
Returns void
exists
Returns boolean
getAge
Returns void
getShaderUniforms
Returns ShaderUniformSet
Object for current animation's render.
load
Loads animation in the world.
Returns void
loadCustom
Loads animation in the world registering it as an Updatable.
Parameters
func: () => void
function to be used as Updatable.update function
Returns void
newTransform
Creates a set of transformations for the current animation.
Parameters
transformations: { name: string; params: any[] }[]
noClear: boolean
Returns void
refresh
Refreshes the animation.
Returns void
resetBlockLightPos
Resets light measuring position for the animation (to it's coordinates).
Returns void
resetTransform
Resets all the transformations made via transform calls.
Returns void
setBlockLightPos
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
Sets light measuring to match the animation coordinated.
Returns void
setIgnoreBlocklight
Parameters
ignore: boolean
Returns void
setIgnoreLightMode
Makes the animation ignore light at all.
Returns void
setInterpolationEnabled
Parameters
enabled: boolean
if true, animation position will be interpolated between tick calls
Returns void
setItemRotation
Specifies item rotation along the three axes.
Parameters
x: number
y: number
z: number
Returns void
setItemSize
Specifies item size.
Parameters
size: number
Returns void
setItemSizeAndRotation
Specifies item size and rotation via single function call.
Parameters
size: number
x: number
y: number
z: number
Returns void
setPos
Changes the animation's position.
Parameters
x: number
y: number
z: number
Returns void
setSkylightMode
Sets light measuring position to always match day/night lightning, even when the animation is not directly illuminated.
Returns void
transform
Returns Transform
Object for current animation's render.
updateRender
Refreshes the animation.
Returns void
Animations are used to display some 3d models in the world without use of entities.
Rendering performs locally in client-side, use packets to transfer data between server and players.