Hi there, after the update a few changes was made to the api enchantments and some of them I was not able to fix yet, do someone know how is the canAddEnchantment working now?
Before it was checking not only the the item is able to receive the enchant but also the level if it already have the enchantment, now it throws errors but I cant receive the true/false to interact and execute other scripts.
This is how it is right now: javascript if (!item.getComponent('enchantable').canAddEnchantment({ type: 'protection', level: 4 })) { world.sendMessage(`cannot be enchanted`) } else { world.sendMessage(`can be enchanted`) }Any idea how can I make it work?
This is what shows on console when[2024-02-07 00:46:12:417 ERROR] [Scripting] Unhandled promise rejection: EnchantmentLevelOutOfBoundsError: When trying to add enchantment instance - Tyring to set enchantment level to 8, range for type protection is [0 - 4].