-
Bug
-
Resolution: Unresolved
-
None
-
1.20.73 Hotfix
-
None
-
Unconfirmed
-
Multiple
When creating an 'ItemStack' and getting 'maxDurability' in the same expression, it throws an error. But when assigning the 'ItemStack' to a variable then accessing 'maxDurability' in a different expression, it works.
const item = new ItemStack("diamond_sword"); const maxDurability = item.getComponent("durability")?.maxDurability ?? 0; // works fine
const maxDurability = new ItemStack("diamond_sword").getComponent("durability")?.maxDurability ?? 0; // Error: failed to get property 'maxDurability'