Experimental

An early preview: docs, the API and the dashboard may change or break.

Report a problem

types.ItemChanges

What items.create and ItemStack:with set; a field left nil keeps what the stack has.

Example

local items = require("@ember/items")
local types = require("@ember/types")

-- The changes `items.create` and `ItemStack:with` take. Every field is optional.
local changes: types.ItemChanges = {
	count = 3,
	name = "<red>Fire Charge",
	lore = { "<gray>Throw it at your enemies." },
	data = { damage = 6 },
}

local stack = items.create("minecraft:fire_charge", changes)
print(stack.count, stack.name)

Fields

itemChanges.count: number?
#

how many, from 1 to 99

Range: count: 1..99

itemChanges.damage: number?
#

how worn it is, from 0 (new) to one less than maxDamage; raises for an item without durability

Range: damage >= 0

itemChanges.data: any?
#

a table of numbers, strings, booleans and tables, kept on the stack for scripts to read back

itemChanges.glint: boolean?
#

true shows the enchantment shimmer, false hides it even on an enchanted item

itemChanges.lore: { types.MiniMessage }?
#

lines shown under the name

itemChanges.name: types.MiniMessage?
#

the name shown instead of the item's own