Mojira Archive
MCPE-154810

GameTest: Accessing ItemEnchantsComponent returns an error

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); }

```

Incomplete

lowlines

2022-04-26, 10:10 AM

2022-04-26, 10:33 AM

2022-04-26, 10:33 AM

0

1

Unconfirmed

1.18.30

-