models

The global instance of the Avatar Models and its subtypes
field signature:
models
Method Property Fluent Description Representation
Field Type a ModelPart

ModelPart.getName

The name of this model part
overload 1:
models:getName()
Method Property Fluent Description Representation
Return Value a String

ModelPart.remove

Removes this part from the parent model part
overload 1:
models:remove()
Method Property Fluent Description Representation
Return Value a ModelPart

ModelPart.getParent

Gets the parent part of this part
If this part has no parent,
returns nil
overload 1:
models:getParent()
Method Property Fluent Description Representation
Return Value either a ModelPart or nil

ModelPart.getType

Returns whether this part is a "GROUP", a "CUBE", or a "MESH"
overload 1:
models:getType()
Method Property Fluent Description Representation
Return Value a String

ModelPart.copy

Returns a copy of this part, with all customizations and vertices copied
Children parts are passed as reference,
in a new list
overload 1:
models:copy(name)
Method Property Fluent Description Representation
name accepts a String
Return Value a ModelPart

ModelPart.getChildren

Gets the children of this part, stored in a table
overload 1:
models:getChildren()
Method Property Fluent Description Representation
Return Value an array of ModelParts

ModelPart.setColor

Sets the color multiplier for this part for primary and secondary colors
Values are RGB from 0 to 1
overload 1:
models:setColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a ModelPart
overload 2:
models:setColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a ModelPart

ModelPart.setScale

Sets the scale factor for this part
Nil values for scale are assumed to be 1
overload 1:
models:setScale(scale)
Method Property Fluent Description Representation
scale accepts a Vector3
Return Value a ModelPart
overload 2:
models:setScale(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.newText

Adds a new Text Render Task on this part
overload 1:
models:newText(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value a TextTask

ModelPart.removeChild

Removes the given part from this part's children list
overload 1:
models:removeChild(part)
Method Property Fluent Description Representation
part accepts a ModelPart
Return Value a ModelPart

ModelPart.getTask

Gets the Render Task with the given name from this part
Returns a table with all tasks if a name is not given
overload 1:
models:getTask()
Method Property Fluent Description Representation
Return Value a table mapping a String to a RenderTask
overload 2:
models:getTask(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value a RenderTask

ModelPart.getScale

Gets the scale of the model part, as a multiple of its Blockbench size
Only changes from {1,
1,1} when you call setScale()
overload 1:
models:getScale()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.addChild

Adds the given part into this part's children list
overload 1:
models:addChild(part)
Method Property Fluent Description Representation
part accepts a ModelPart
Return Value a ModelPart

ModelPart.moveTo

Moves this part to be a child of the given part
overload 1:
models:moveTo(part)
Method Property Fluent Description Representation
part accepts a ModelPart
Return Value a ModelPart

ModelPart.getTextures

Returns a table with all textures used by this part
Does not include children textures,
so groups usually will return an empty table
overload 1:
models:getTextures()
Method Property Fluent Description Representation
Return Value a table

ModelPart.getPos

Gets the position of the model part, as an offset from its position in Blockbench
Only changes from {0,
0,0} when you call setPos()
overload 1:
models:getPos()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getRot

Gets the rotation of the model part, including its rotation in Blockbench
For relative rotation values,
check out the "offset" rot functions
overload 1:
models:getRot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.setPos

Sets the position offset for this part from its Blockbench position
Nil values for position are assumed to be 0
overload 1:
models:setPos(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a ModelPart
overload 2:
models:setPos(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.setUV

Sets the UV of this part
This function is normalized,
meaning it works with values 0 to 1
If you say setUV(0.5,
0.25), for example, it will scroll by half of your texture width to the right, and one-fourth of the texture width downwards
overload 1:
models:setUV(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a ModelPart
overload 2:
models:setUV(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a ModelPart

ModelPart.getUV

Gets the UV of this part
This function is normalized,
meaning it will return values between 0 to 1
overload 1:
models:getUV()
Method Property Fluent Description Representation
Return Value a Vector2

ModelPart.overrideVanillaRot

Returns if this part vanilla rotation is being overridden by an animation
overload 1:
models:overrideVanillaRot()
Method Property Fluent Description Representation
Return Value a Boolean

ModelPart.getOffsetScale

Gets the scale offset of the model part, offset from its default scale
For absolute scale values,
check out the non-offset rot functions
overload 1:
models:getOffsetScale()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.overrideVanillaPos

Returns if this part vanilla position is being overridden by an animation
overload 1:
models:overrideVanillaPos()
Method Property Fluent Description Representation
Return Value a Boolean

ModelPart.setPreRender

Sets a function to run before this part starts being rendered
overload 1:
models:setPreRender(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a ModelPart

ModelPart.setMidRender

Sets a function to run during the middle of this part's rendering, after its matrices are calculated
overload 1:
models:setMidRender(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a ModelPart

ModelPart.getOffsetPivot

Gets the pivot offset of the model part, offset from its pivot in Blockbench
For absolute pivot point values,
check out the non-offset pivot functions
overload 1:
models:getOffsetPivot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.setMatrix

Sets the given matrix as the position matrix for this model part
The normal matrix is automatically calculated as the inverse transpose of this matrix
Calling this DOES NOT CHANGE the values of position,
rot, or scale in the model part
If you call setPos() or a similar function,
the effects of setMatrix() will be overwritten
overload 1:
models:setMatrix(matrix)
Method Property Fluent Description Representation
matrix accepts a Matrix4
Return Value a ModelPart

ModelPart.getAnimPos

Gets the position offset provided by the currently active animation of this model part
overload 1:
models:getAnimPos()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getPivot

Gets the pivot point of the model part, including its pivot in Blockbench
For relative values,
check out the "offset" pivot functions
overload 1:
models:getPivot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getAnimRot

Gets the rotation offset provided by the currently active animation of this model part
overload 1:
models:getAnimRot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getOffsetRot

Gets the rotation offset of the model part, offset from its rotation in Blockbench
For absolute rotation values,
check out the non-offset rot functions
overload 1:
models:getOffsetRot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getAnimScale

Gets the scale multiplier provided by the currently active animation of this model part
overload 1:
models:getAnimScale()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getTrueRot

Gets the true rotation of this model part, which is a sum of the rotation, the offset rotation and the animation position
overload 1:
models:getTrueRot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.setRot

Sets the absolute rotation for this part
Nil values for rotation are assumed to be 0
Angles are given in degrees
For relative rotation values,
check out the "offset" rot functions
overload 1:
models:setRot(rot)
Method Property Fluent Description Representation
rot accepts a Vector3
Return Value a ModelPart
overload 2:
models:setRot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.setPostRender

Sets a function to run after this part and its children are rendered
overload 1:
models:setPostRender(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a ModelPart

ModelPart.setPivot

Sets the absolute pivot for this part
Nil values are assumed to be 0
For relative pivot offsets,
check out the "offset" pivot functions
overload 1:
models:setPivot(pivot)
Method Property Fluent Description Representation
pivot accepts a Vector3
Return Value a ModelPart
overload 2:
models:setPivot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.getTruePivot

Gets the true pivot of this model part, which is a sum of the pivot and the offset pivot
overload 1:
models:getTruePivot()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getTruePos

Gets the true position of this model part, which is a sum of the position and the animation position
overload 1:
models:getTruePos()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.isChildOf

Checks if this part is a child of the given part
overload 1:
models:isChildOf(part)
Method Property Fluent Description Representation
part accepts a ModelPart
Return Value a Boolean

ModelPart.getTrueScale

Gets the true scale of this model part, which is a sum of the scale, the offset scale and the animation scale
overload 1:
models:getTrueScale()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.setOffsetScale

Sets the scale offset for this part
Nil values are assumed to be 1
For absolute scale values,
check out the non-offset rot functions
overload 1:
models:setOffsetScale(offsetScale)
Method Property Fluent Description Representation
offsetScale accepts a Vector3
Return Value a ModelPart
overload 2:
models:setOffsetScale(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.setOffsetRot

Sets the rotation offset for this part
Nil values for rotation are assumed to be 0
Angles are given in degrees
For absolute rotation values,
check out the non-offset rot functions
overload 1:
models:setOffsetRot(offsetRot)
Method Property Fluent Description Representation
offsetRot accepts a Vector3
Return Value a ModelPart
overload 2:
models:setOffsetRot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.getPositionMatrix

Recalculates the matrix for this model part, based on its current position, rotation, scale, and pivot, then returns this matrix
overload 1:
models:getPositionMatrix()
Method Property Fluent Description Representation
Return Value a Matrix4

ModelPart.setOffsetPivot

Sets the pivot offset point for this part (multiplicative)
Nil values are assumed to be 0
For absolute pivot point values,
check out the non-offset pivot functions
overload 1:
models:setOffsetPivot(offsetPivot)
Method Property Fluent Description Representation
offsetPivot accepts a Vector3
Return Value a ModelPart
overload 2:
models:setOffsetPivot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.getNormalMatrix

Recalculates the normal matrix for this model part, based on its current position, rotation, scale, and pivot, then returns this matrix
overload 1:
models:getNormalMatrix()
Method Property Fluent Description Representation
Return Value a Matrix3

ModelPart.getPrimaryTexture

Gets the primary texture of this part
Returns two values,
first being the override type, second being the value, if any.
overload 1:
models:getPrimaryTexture()
Method Property Fluent Description Representation
Return Value a Varargs

ModelPart.getNormalMatrixRaw

Returns the normal matrix for this model part
The Raw version of the function is different in that it doesn't recalculate the matrix before returning it
overload 1:
models:getNormalMatrixRaw()
Method Property Fluent Description Representation
Return Value a Matrix3

ModelPart.setPrimaryTexture

Sets the primary texture override of this part
Check the TextureType types in the list docs
If using "resource",
the second parameter should indicate the path to the Minecraft texture you want to use
If using "custom",
the second parameter should indicate a texture object
overload 1:
models:setPrimaryTexture(textureType)
Method Property Fluent Description Representation
textureType accepts a String
Return Value a ModelPart
overload 2:
models:setPrimaryTexture(resource, path)
Method Property Fluent Description Representation
resource accepts a String
path accepts a String
Return Value a ModelPart
overload 3:
models:setPrimaryTexture(custom, texture)
Method Property Fluent Description Representation
custom accepts a String
texture accepts a Texture
Return Value a ModelPart

ModelPart.getTextureSize

Gets the width, height of this part's texture in pixels
Throws an error if this part has multiple different-sized textures on it,
or if the part is a Group
overload 1:
models:getTextureSize()
Method Property Fluent Description Representation
Return Value a Vector2

ModelPart.getSecondaryColor

Gets the secondary color multiplier of this part
Values are RGB from 0 to 1
overload 1:
models:getSecondaryColor()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.partToWorldMatrix

Gets a matrix which transforms a point from this part's position to a world location
Recommended to use this in POST_RENDER,
as by then the matrix is updated
In RENDER it will be 1 frame behind the part's visual position for that frame
Also,
if the model is not rendered in-world, the part's matrix will not be updated
Paperdoll rendering and other UI renderings will not affect this matrix
overload 1:
models:partToWorldMatrix()
Method Property Fluent Description Representation
Return Value a Matrix4

ModelPart.setUVMatrix

Sets the UV matrix of this part
This matrix is applied to all UV points during the transform,
with the UVs treated as homogeneous vectors
setUV() and setUVPixels() are just simpler ways of setting this matrix
overload 1:
models:setUVMatrix(matrix)
Method Property Fluent Description Representation
matrix accepts a Matrix3
Return Value a ModelPart

ModelPart.getPrimaryColor

Gets the primary color multiplier of this part
Values are RGB from 0 to 1
overload 1:
models:getPrimaryColor()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.setPrimaryColor

Sets the primary color multiplier for this part
Values are RGB from 0 to 1
overload 1:
models:setPrimaryColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a ModelPart
overload 2:
models:setPrimaryColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a ModelPart

ModelPart.getUVPixels

Gets the UV of this part
Automatically multiplies the result by getTextureSize()
Errors if the part has multiple different-sized textures of if the part is a Group
overload 1:
models:getUVPixels()
Method Property Fluent Description Representation
Return Value a Vector2

ModelPart.setUVPixels

Sets the UV of this part in pixels
Automatically divides by the results of getTextureSize(),
so you can just input the number of pixels you want the UV to scroll by
Errors if the part has multiple different-sized textures
If this part is a Group,
it will attempt to setUVPixels on its children
overload 1:
models:setUVPixels(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a ModelPart
overload 2:
models:setUVPixels(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a ModelPart

ModelPart.getUVMatrix

Gets the UV matrix of this part
overload 1:
models:getUVMatrix()
Method Property Fluent Description Representation
Return Value a Matrix3

ModelPart.getOverlay

Gets the overlay color you set earlier to this part
Does not interact with Minecraft's overlay system,
only retrieving values you set earlier with setOverlay()
overload 1:
models:getOverlay()
Method Property Fluent Description Representation
Return Value a Vector2

ModelPart.setLight

Sets the light level to be used when rendering this part
Values you give are 0 to 15,
indicating the block light and sky light levels you want to use
Passing nil will reset the lighting override for this part
overload 1:
models:setLight(light)
Method Property Fluent Description Representation
light accepts a Vector2
Return Value a ModelPart
overload 2:
models:setLight(blockLight, skyLight)
Method Property Fluent Description Representation
blockLight accepts an Integer
skyLight accepts an Integer
Return Value a ModelPart

ModelPart.getLight

Gets the light level you set earlier to this part
Does not interact with Minecraft's lighting system,
only retrieving values you set earlier with setLight()
overload 1:
models:getLight()
Method Property Fluent Description Representation
Return Value a Vector2

ModelPart.setSecondaryColor

Sets the secondary color multiplier for this part
Values are RGB from 0 to 1
overload 1:
models:setSecondaryColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a ModelPart
overload 2:
models:setSecondaryColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a ModelPart

ModelPart.setOverlay

Sets the overlay color to be used when rendering this part
Values you give are 0 to 15,
indicating the white overlay and the damage overlay levels you want to use
Passing nil will reset the overlay override for this part
overload 1:
models:setOverlay(overlay)
Method Property Fluent Description Representation
overlay accepts a Vector2
Return Value a ModelPart
overload 2:
models:setOverlay(whiteOverlay, hurtOverlay)
Method Property Fluent Description Representation
whiteOverlay accepts an Integer
hurtOverlay accepts an Integer
Return Value a ModelPart

ModelPart.setParentType

Sets the parent type of the part
See the ParentType parts in the list docs for legal types
overload 1:
models:setParentType(parentType)
Method Property Fluent Description Representation
parentType accepts a String
Return Value a ModelPart

ModelPart.getOpacity

Gets the opacity multiplier of this part
Note that opacity settings will only take effect if the part has a suitable Render Type for them,
mainly TRANSLUCENT
Check out modelPart.setPrimaryRenderType() for how to do this
overload 1:
models:getOpacity()
Method Property Fluent Description Representation
Return Value a Number

ModelPart.getParentType

Returns the current parent type of the part
overload 1:
models:getParentType()
Method Property Fluent Description Representation
Return Value a String

ModelPart.setOpacity

Sets the opacity multiplier of this part
Note that opacity settings will only take effect if the part has a suitable Render Type for them,
mainly TRANSLUCENT
Check out modelPart.setPrimaryRenderType() for how to do this
overload 1:
models:setOpacity(opacity)
Method Property Fluent Description Representation
opacity accepts a Number
Return Value a ModelPart

ModelPart.addTask

Adds the given Render Task on this part
overload 1:
models:addTask(renderTask)
Method Property Fluent Description Representation
renderTask accepts a RenderTask
Return Value a RenderTask

ModelPart.newSprite

Adds a new Sprite Render Task on this part
overload 1:
models:newSprite(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value a SpriteTask

ModelPart.newItem

Adds a new Item Render Task on this part
overload 1:
models:newItem(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value an ItemTask

ModelPart.newBlock

Adds a new Block Render Task on this part
overload 1:
models:newBlock(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value a BlockTask

ModelPart.removeTask

Removes the Task with the given name from this part
Removes ALL tasks if a name is not given
overload 1:
models:removeTask()
Method Property Fluent Description Representation
Return Value a ModelPart
overload 2:
models:removeTask(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value a ModelPart
overload 3:
models:removeTask(renderTask)
Method Property Fluent Description Representation
renderTask accepts a RenderTask
Return Value a ModelPart

ModelPart.getAllVertices

Return a table of all texture ids and their vertices
overload 1:
models:getAllVertices()
Method Property Fluent Description Representation
Return Value a table

ModelPart.getVertices

Return a table with all vertices from the given texture id
Returns nil if no vertices were found
overload 1:
models:getVertices(textureID)
Method Property Fluent Description Representation
textureID accepts a String
Return Value a table

ModelPart.newPart

Creates a new, empty, group model part as a child of this part, at the same pivot point
Takes two arguments, the new part's name,
and optionally its parent type
overload 1:
models:newPart(name)
Method Property Fluent Description Representation
name accepts a String
Return Value a ModelPart
overload 2:
models:newPart(name, parentType)
Method Property Fluent Description Representation
name accepts a String
parentType accepts a String
Return Value a ModelPart

ModelPart.newEntity

Adds a new Entity Render Task on this part
overload 1:
models:newEntity(taskName)
Method Property Fluent Description Representation
taskName accepts a String
Return Value an EntityTask

ModelPart.setVisible

Sets this part to be visible or invisible
The default value is nil,
meaning the part copies its visibility from its parent part
overload 1:
models:setVisible(visible)
Method Property Fluent Description Representation
visible accepts a Boolean
Return Value a ModelPart

ModelPart.getVisible

Gets whether or not this model part is visible
The default value is nil,
meaning it copies the visibility of its parent part during rendering
overload 1:
models:getVisible()
Method Property Fluent Description Representation
Return Value either a Boolean or nil

ModelPart.getColor

Returns the average set color from this part, as adding the primary color with the secondary, then dividing them
Values are RGB from 0 to 1
overload 1:
models:getColor()
Method Property Fluent Description Representation
Return Value a Vector3

ModelPart.getSecondaryTexture

Gets the secondary texture of this part
Returns two values,
first being the override type, second being the value, if any.
overload 1:
models:getSecondaryTexture()
Method Property Fluent Description Representation
Return Value anything

ModelPart.getPrimaryDefinedTextures

Gets the primary textures of this part
Returns a table of each texture for the specified face.
overload 1:
models:getPrimaryDefinedTextures()
Method Property Fluent Description Representation
Return Value anything

ModelPart.getSecondaryDefinedTextures

Gets the secondary textures of this part
Returns a table of each texture for the specified face.
overload 1:
models:getSecondaryDefinedTextures()
Method Property Fluent Description Representation
Return Value anything

ModelPart.overrideVanillaScale

Returns if this part vanilla scale is being overridden by an animation
overload 1:
models:overrideVanillaScale()
Method Property Fluent Description Representation
Return Value a Boolean

ModelPart.setPrimaryRenderType

Sets the current primary render type of this model part
Nil by default,
meaning the part copies the primary render type of its parent during rendering
Check the docs enum command for all render types
overload 1:
models:setPrimaryRenderType(renderType)
Method Property Fluent Description Representation
renderType accepts a String
Return Value a ModelPart

ModelPart.getPositionMatrixRaw

Returns the position matrix for this model part
The Raw version of the function is different in that it doesn't recalculate the matrix before getting it
overload 1:
models:getPositionMatrixRaw()
Method Property Fluent Description Representation
Return Value a Matrix4

ModelPart.getPrimaryRenderType

Gets the current primary render type of this model part
Nil by default,
meaning the part copies the primary render type of its parent
overload 1:
models:getPrimaryRenderType()
Method Property Fluent Description Representation
Return Value either a RenderTypes or nil

ModelPart.getSecondaryRenderType

Gets the current secondary render type of this model part
Nil by default,
meaning the part copies the secondary render type of its parent
overload 1:
models:getSecondaryRenderType()
Method Property Fluent Description Representation
Return Value either a RenderTypes or nil

ModelPart.setSecondaryTexture

Sets the secondary texture override of this part
Check the TextureType types in the list docs
If using "resource",
the second parameter should indicate the path to the Minecraft texture you want to use
If using "custom",
the second parameter should indicate a texture object
overload 1:
models:setSecondaryTexture(textureType)
Method Property Fluent Description Representation
textureType accepts a String
Return Value a ModelPart
overload 2:
models:setSecondaryTexture(resource, path)
Method Property Fluent Description Representation
resource accepts a String
path accepts a String
Return Value a ModelPart
overload 3:
models:setSecondaryTexture(custom, texture)
Method Property Fluent Description Representation
custom accepts a String
texture accepts a Texture
Return Value a ModelPart

ModelPart.setSecondaryRenderType

Sets the current secondary render type of this model part
Nil by default,
meaning the part copies the secondary render type of its parent during rendering
Check the docs enum command for all render types
overload 1:
models:setSecondaryRenderType(renderType)
Method Property Fluent Description Representation
renderType accepts a String
Return Value a ModelPart

ModelPart.color

Sets the color multiplier for this part for primary and secondary colors
Values are RGB from 0 to 1
overload 1:
models:color(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a ModelPart
overload 2:
models:color(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a ModelPart

ModelPart.scale

Sets the scale factor for this part
Nil values for scale are assumed to be 1
overload 1:
models:scale(scale)
Method Property Fluent Description Representation
scale accepts a Vector3
Return Value a ModelPart
overload 2:
models:scale(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.pos

Sets the position offset for this part from its Blockbench position
Nil values for position are assumed to be 0
overload 1:
models:pos(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a ModelPart
overload 2:
models:pos(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.uv

Sets the UV of this part
This function is normalized,
meaning it works with values 0 to 1
If you say setUV(0.5,
0.25), for example, it will scroll by half of your texture width to the right, and one-fourth of the texture width downwards
overload 1:
models:uv(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a ModelPart
overload 2:
models:uv(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a ModelPart

ModelPart.matrix

Sets the given matrix as the position matrix for this model part
The normal matrix is automatically calculated as the inverse transpose of this matrix
Calling this DOES NOT CHANGE the values of position,
rot, or scale in the model part
If you call setPos() or a similar function,
the effects of setMatrix() will be overwritten
overload 1:
models:matrix(matrix)
Method Property Fluent Description Representation
matrix accepts a Matrix4
Return Value a ModelPart

ModelPart.rot

Sets the absolute rotation for this part
Nil values for rotation are assumed to be 0
Angles are given in degrees
For relative rotation values,
check out the "offset" rot functions
overload 1:
models:rot(rot)
Method Property Fluent Description Representation
rot accepts a Vector3
Return Value a ModelPart
overload 2:
models:rot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.pivot

Sets the absolute pivot for this part
Nil values are assumed to be 0
For relative pivot offsets,
check out the "offset" pivot functions
overload 1:
models:pivot(pivot)
Method Property Fluent Description Representation
pivot accepts a Vector3
Return Value a ModelPart
overload 2:
models:pivot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.offsetScale

Sets the scale offset for this part
Nil values are assumed to be 1
For absolute scale values,
check out the non-offset rot functions
overload 1:
models:offsetScale(offsetScale)
Method Property Fluent Description Representation
offsetScale accepts a Vector3
Return Value a ModelPart
overload 2:
models:offsetScale(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.offsetRot

Sets the rotation offset for this part
Nil values for rotation are assumed to be 0
Angles are given in degrees
For absolute rotation values,
check out the non-offset rot functions
overload 1:
models:offsetRot(offsetRot)
Method Property Fluent Description Representation
offsetRot accepts a Vector3
Return Value a ModelPart
overload 2:
models:offsetRot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.offsetPivot

Sets the pivot offset point for this part (multiplicative)
Nil values are assumed to be 0
For absolute pivot point values,
check out the non-offset pivot functions
overload 1:
models:offsetPivot(offsetPivot)
Method Property Fluent Description Representation
offsetPivot accepts a Vector3
Return Value a ModelPart
overload 2:
models:offsetPivot(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a ModelPart

ModelPart.primaryTexture

Sets the primary texture override of this part
Check the TextureType types in the list docs
If using "resource",
the second parameter should indicate the path to the Minecraft texture you want to use
If using "custom",
the second parameter should indicate a texture object
overload 1:
models:primaryTexture(textureType)
Method Property Fluent Description Representation
textureType accepts a String
Return Value a ModelPart
overload 2:
models:primaryTexture(resource, path)
Method Property Fluent Description Representation
resource accepts a String
path accepts a String
Return Value a ModelPart
overload 3:
models:primaryTexture(custom, texture)
Method Property Fluent Description Representation
custom accepts a String
texture accepts a Texture
Return Value a ModelPart

ModelPart.uvMatrix

Sets the UV matrix of this part
This matrix is applied to all UV points during the transform,
with the UVs treated as homogeneous vectors
setUV() and setUVPixels() are just simpler ways of setting this matrix
overload 1:
models:uvMatrix(matrix)
Method Property Fluent Description Representation
matrix accepts a Matrix3
Return Value a ModelPart

ModelPart.primaryColor

Sets the primary color multiplier for this part
Values are RGB from 0 to 1
overload 1:
models:primaryColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a ModelPart
overload 2:
models:primaryColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a ModelPart

ModelPart.uvPixels

Sets the UV of this part in pixels
Automatically divides by the results of getTextureSize(),
so you can just input the number of pixels you want the UV to scroll by
Errors if the part has multiple different-sized textures
If this part is a Group,
it will attempt to setUVPixels on its children
overload 1:
models:uvPixels(uv)
Method Property Fluent Description Representation
uv accepts a Vector2
Return Value a ModelPart
overload 2:
models:uvPixels(u, v)
Method Property Fluent Description Representation
u accepts a Number
v accepts a Number
Return Value a ModelPart

ModelPart.light

Sets the light level to be used when rendering this part
Values you give are 0 to 15,
indicating the block light and sky light levels you want to use
Passing nil will reset the lighting override for this part
overload 1:
models:light(light)
Method Property Fluent Description Representation
light accepts a Vector2
Return Value a ModelPart
overload 2:
models:light(blockLight, skyLight)
Method Property Fluent Description Representation
blockLight accepts an Integer
skyLight accepts an Integer
Return Value a ModelPart

ModelPart.secondaryColor

Sets the secondary color multiplier for this part
Values are RGB from 0 to 1
overload 1:
models:secondaryColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a ModelPart
overload 2:
models:secondaryColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a ModelPart

ModelPart.overlay

Sets the overlay color to be used when rendering this part
Values you give are 0 to 15,
indicating the white overlay and the damage overlay levels you want to use
Passing nil will reset the overlay override for this part
overload 1:
models:overlay(overlay)
Method Property Fluent Description Representation
overlay accepts a Vector2
Return Value a ModelPart
overload 2:
models:overlay(whiteOverlay, hurtOverlay)
Method Property Fluent Description Representation
whiteOverlay accepts an Integer
hurtOverlay accepts an Integer
Return Value a ModelPart

ModelPart.parentType

Sets the parent type of the part
See the ParentType parts in the list docs for legal types
overload 1:
models:parentType(parentType)
Method Property Fluent Description Representation
parentType accepts a String
Return Value a ModelPart

ModelPart.opacity

Sets the opacity multiplier of this part
Note that opacity settings will only take effect if the part has a suitable Render Type for them,
mainly TRANSLUCENT
Check out modelPart.setPrimaryRenderType() for how to do this
overload 1:
models:opacity(opacity)
Method Property Fluent Description Representation
opacity accepts a Number
Return Value a ModelPart

ModelPart.visible

Sets this part to be visible or invisible
The default value is nil,
meaning the part copies its visibility from its parent part
overload 1:
models:visible(visible)
Method Property Fluent Description Representation
visible accepts a Boolean
Return Value a ModelPart

ModelPart.primaryRenderType

Sets the current primary render type of this model part
Nil by default,
meaning the part copies the primary render type of its parent during rendering
Check the docs enum command for all render types
overload 1:
models:primaryRenderType(renderType)
Method Property Fluent Description Representation
renderType accepts a String
Return Value a ModelPart

ModelPart.secondaryTexture

Sets the secondary texture override of this part
Check the TextureType types in the list docs
If using "resource",
the second parameter should indicate the path to the Minecraft texture you want to use
If using "custom",
the second parameter should indicate a texture object
overload 1:
models:secondaryTexture(textureType)
Method Property Fluent Description Representation
textureType accepts a String
Return Value a ModelPart
overload 2:
models:secondaryTexture(resource, path)
Method Property Fluent Description Representation
resource accepts a String
path accepts a String
Return Value a ModelPart
overload 3:
models:secondaryTexture(custom, texture)
Method Property Fluent Description Representation
custom accepts a String
texture accepts a Texture
Return Value a ModelPart

ModelPart.secondaryRenderType

Sets the current secondary render type of this model part
Nil by default,
meaning the part copies the secondary render type of its parent during rendering
Check the docs enum command for all render types
overload 1:
models:secondaryRenderType(renderType)
Method Property Fluent Description Representation
renderType accepts a String
Return Value a ModelPart

ModelPart.preRender

Function to run before this part starts being rendered
field signature:
preRender
Method Property Fluent Description Representation
Field Type a function

ModelPart.midRender

Function to run during the middle of this part's rendering, after its matrices are calculated
field signature:
midRender
Method Property Fluent Description Representation
Field Type a function

ModelPart.postRender

Function to run after this part and its children are rendered
field signature:
postRender
Method Property Fluent Description Representation
Field Type a function
a a