const name = item.nameTag || item.typeId.replace("minecraft:", "").replace(/_/g, " ");
const displayName = name.charAt(0).toUpperCase() + name.slice(1);
const enchantments = item.getComponent("minecraft:enchantments")?.enchantments || [];
const enchantmentList = [...enchantments].map(e => `${e.type.id.replace("minecraft:", "").replace(/_/g, " ")} Lvl ${e.level}`).join(", ");
form.button(i + 45, displayName, enchantmentList ? [enchantmentList] : [], item.typeId, item.amount);
#Get Enchantments
1 messages · Page 1 of 1 (latest)
sorry but I think you meant enchantable
and that's not how you get the enchantments