Class in @minecraft/server
Extends ItemComponent
A leather item’s dye.
import { ItemDyeableComponent } from '@minecraft/server';Example
Section titled “Example”import { ItemStack, type ItemDyeableComponent } from '@minecraft/server';
const item = new ItemStack('minecraft:diamond_sword');const component: ItemDyeableComponent | undefined = item.getComponent('minecraft:dyeable');if (component) { console.log(item.typeId, component.typeId);}import { ItemStack } from '@minecraft/server';
const item = new ItemStack('minecraft:diamond_sword');const component = item.getComponent('minecraft:dyeable');if (component) { console.log(item.typeId, component.typeId);}Properties
Section titled “Properties”componentId
Section titled “componentId”static read-only
static readonly componentId = "minecraft:dyeable";optional
color?: RGB;The dye on the item, or undefined for none. Setting it changes the stack; undefined washes it off.
Types
defaultColor
Section titled “defaultColor”read-only optional
readonly defaultColor?: RGB;The colour of undyed leather.
Types
Used by
Section titled “Used by”ItemComponentTypeMap.dyeable, ItemComponentTypeMap.minecraft:dyeable
Inherited
Section titled “Inherited”From ItemComponent: typeId, isValid