You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#121
Update `durabilityUsed` getter to support items with components.
* Modify `durabilityUsed` getter in `index.js` to check the `components` array for the `damage` component.
* Use the `damage` component value for `durabilityUsed` if found.
* Fall back to checking the `Damage` field in `nbt` or `metadata` if the `damage` component is not found.
* Add test cases in `test/basic.test.js` to verify `durabilityUsed` returns the correct value for items with and without the `damage` component.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/PrismarineJS/prismarine-item/issues/121?shareId=XXXX-XXXX-XXXX-XXXX).
0 commit comments