Cuberite Forum

Full Version: [SOLVED] Get list (string) of item enchantments
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm try to get item enchantments list. How can I do it?
Code:
armor = Player:GetInventory():GetArmorGrid();

local tmp = nil

for i = 0, armor:GetNumSlots()-1 do
  tmp = armor:GetSlot(i):IsEnchantable();
end

Return error.

Code:
error in function 'IsEnchantable'.
argument #1 is 'const cItem'; 'cItem' expected.

Any help me?
cItem:IsEnchantable is static. Use this:

tmp = cItem:IsEnchantable(armor:GetSlot(i).m_ItemType)
, thank you. I found other solution
Code:
armor:GetSlot(i).m_Enchantments:IsEmpty()
I found solution for my question:
Code:
armor:GetSlot(i).m_Enchantments:ToString()