-
Bug
-
Resolution: Incomplete
-
None
-
1.18.30
-
None
-
Unconfirmed
-
Windows
When accessing the enchantments component of an ItemStack, the enchantments are not iterable and will crash the game if Array.from() is called on it.
```
const inventory = player.getComponent("inventory");
const container = inventory.container;
for (let i=0; i<container.size; i++)
{ const itemStack = container.getItem(i); const enchantmentComponent = itemStack.getComponent("enchantments"); const enchantments = enchantmentComponent.enchantments; // Not a function error enchantments.next(); // Crashes game Array.from(enchantments); }```