Custom Model Data (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.5, 2.12 (floats/flags/strings/colours/full model data)

Syntax

[the] [custom] model data of %itemtypes%

Description

Get/set the custom model data of an item. Using just `custom model data` will return an integer. Items without model data will return 0. Since 1.21.4, custom model data instead consists of a list of numbers (floats), a list of booleans (flags), a list of strings, and a list of colours. Accessing and modifying these lists can be done type-by-type, or all at once with `complete custom model data`. This is the more accurate and recommended method of using custom model data.

Examples

set custom model data of player's tool to 3
set {_model} to custom model data of player's tool
set custom model data colours of {_flag} to red, white, and blue
add 10.5 to the model data floats of {_flag}
set the full custom model data of {_item} to 10, "sword", and rgb(100, 200, 30)

View source