ItemModel
Index
Properties
Methods
- addToMesh
- getCacheKey
- getIconBitmap
- getIconBitmapNoReload
- getItemRenderMesh
- getMeshTextureName
- getModelForItemInstance
- getShaderUniforms
- getSpriteMesh
- getUiGlintMaterialName
- getUiMaterialName
- getUiTextureName
- getWorldGlintMaterialName
- getWorldMaterialName
- getWorldTextureName
- isEmpty
- isEmptyInUi
- isEmptyInWorld
- isNonExistant
- isSpriteInUi
- isSpriteInWorld
- isUsingOverrideCallback
- newTexture
- occupy
- overridesHand
- overridesUi
- queueReload
- releaseIcon
- reloadIcon
- reloadIconIfDirty
- removeModUiSpriteTexture
- setCacheKey
- setGlintMaterial
- setHandGlintMaterial
- setHandMaterial
- setHandModel
- setHandTexture
- setItemTexture
- setItemTexturePath
- setMaterial
- setModUiSpriteBitmap
- setModUiSpriteName
- setModUiSpritePath
- setModel
- setModelOverrideCallback
- setSpriteHandRender
- setSpriteUiRender
- setTexture
- setUiGlintMaterial
- setUiMaterial
- setUiModel
- setUiTexture
- updateForBlockVariant
Properties
readonlydata
Item or block data current ItemModel relates to.
readonlyid
Item or block ID current ItemModel relates to.
Methods
addToMesh
Parameters
mesh: RenderMesh
x: number
y: number
z: number
Returns void
getCacheKey
Returns string
getIconBitmap
Returns Bitmap
getIconBitmapNoReload
Returns Bitmap
getItemRenderMesh
Parameters
count: number
randomize: boolean
Returns RenderMesh
getMeshTextureName
Returns string
getModelForItemInstance
Parameters
id: number
count: number
data: number
extra: ItemExtraData
Returns ItemModel
getShaderUniforms
Returns ShaderUniformSet
getSpriteMesh
Returns RenderMesh
getUiGlintMaterialName
Returns string
getUiMaterialName
Returns string
getUiTextureName
Returns string
getWorldGlintMaterialName
Returns string
getWorldMaterialName
Returns string
getWorldTextureName
Returns string
isEmpty
Returns boolean
true
, if the model is empty.
isEmptyInUi
Returns boolean
isEmptyInWorld
Returns boolean
isNonExistant
Returns boolean
isSpriteInUi
Returns boolean
isSpriteInWorld
Returns boolean
isUsingOverrideCallback
Returns boolean
newTexture
Returns Bitmap
occupy
Returns ItemModel
overridesHand
Returns boolean
true
, if this item model overrides the default model in player's hand.
overridesUi
Returns boolean
true
, if this item model overrides the default model in player's inventory.
queueReload
Parameters
optionallistener: IconRebuildListener
Returns Bitmap
releaseIcon
Returns void
reloadIcon
Returns void
reloadIconIfDirty
Returns void
removeModUiSpriteTexture
Returns ItemModel
setCacheKey
Parameters
key: string
Returns void
setGlintMaterial
Parameters
material: string
Returns ItemModel
setHandGlintMaterial
Parameters
material: string
Returns ItemModel
setHandMaterial
Sets item model's material only in player's hand.
Parameters
texture: string
material name to be used for the model
Returns ItemModel
setHandModel
Sets item's model to display only in player's hand.
Parameters
model: RenderMesh | Model | Model
RenderMesh, ICRender.Model or BlockRenderer.Model to be used as item model
optionaltexture: string
texture name to be used for the model (use
"atlas::terrain"
for block textures)optionalmaterial: string
material name to be used for the model
Returns ItemModel
setHandTexture
Sets item model's texture only in player's hand.
Parameters
texture: string
texture name to be used for the model (use
"atlas::terrain"
for block textures)
Returns ItemModel
setItemTexture
Parameters
name: string
index: number
Returns ItemModel
setItemTexturePath
Parameters
path: string
Returns ItemModel
setMaterial
Sets item model's material in both player's inventory and in hand.
Parameters
texture: string
material name to be used for the model.
Returns ItemModel
setModUiSpriteBitmap
Parameters
bitmap: Bitmap
Returns ItemModel
setModUiSpriteName
Parameters
name: string
index: number
Returns ItemModel
setModUiSpritePath
Parameters
path: string
Returns ItemModel
setModel
Sets item's model to display both in the inventory and in hand.
Parameters
model: RenderMesh | Model | Model
RenderMesh, ICRender.Model or BlockRenderer.Model to be used as item model
optionaltexture: string
texture name to be used for the model (use
"atlas::terrain"
for block textures)optionalmaterial: string
material name to be used for the model
Returns ItemModel
setModelOverrideCallback
Parameters
callback: ModelOverrideFunction
Returns ItemModel
setSpriteHandRender
Determines whether an item being held in the hand should be displayed as a sprite, or if a model should be used instead, which can be particularly relevant for items such as blocks.
Parameters
isSprite: boolean
Returns ItemModel
setSpriteUiRender
Determines whether an item should be displayed as a sprite within inventory, or if a model should be used instead, which can be particularly relevant for items such as blocks.
Parameters
isSprite: boolean
Returns ItemModel
setTexture
Sets item model's texture in both player's inventory and in hand.
Parameters
texture: string
texture name to be used for the model (use
"atlas::terrain"
for block textures)
Returns ItemModel
setUiGlintMaterial
Parameters
material: string
Returns ItemModel
setUiMaterial
Sets item model's material only in player's inventory.
Parameters
texture: string
material name to be used for the model
Returns ItemModel
setUiModel
Sets item's model to display only in player's inventory.
Parameters
model: RenderMesh | Model | Model
RenderMesh, ICRender.Model or BlockRenderer.Model to be used as item model
optionaltexture: string
texture name to be used for the model (use
"atlas::terrain"
for block textures)optionalmaterial: string
material name to be used for the model
Returns ItemModel
setUiTexture
Sets item model's texture only in player's inventory.
Parameters
texture: string
texture name to be used for the model (use
"atlas::terrain"
for block textures)
Returns ItemModel
updateForBlockVariant
Parameters
variant: any
Returns void
Class representing item model in player's hand and/or inventory. To get an instance of this class from your code, use ItemModel.getFor static function.
The coordinates of the full block in player's hand or inventory is (0, 0, 0), (1, 1, 1), so it is generally recommended to use the models that fit that bound at least for the inventory.
2.0.2b20