Skip to content

Conversation

@shekinahfire77
Copy link

This PR fixes issue #553 where items held in the off-hand were not found by skills.discard and therefore could not be tossed.

Changes:

  • src/agent/library/skills.js: discard() now searches bot.inventory.slots as a fallback (this includes off-hand slots) and uses the existing bot.toss() to remove items.
  • tests/test_discard_offhand.js: small unit-style test that stubs a bot with an off-hand-like slot and verifies discard calls toss.

Why:

  • bot.inventory.items() may not include off-hand/armor slots in some runtimes; scanning inventory.slots ensures items in off-hand are considered.

Notes:

  • The test is lightweight and does not require a Minecraft server.
  • I kept changes minimal to avoid repo-wide style edits.

Please let me know if you'd like the test excluded from the PR; otherwise CI/maintainers can review and merge.

@uukelele-scratch
Copy link
Contributor

#618 attempts to achieve a much simpler solution

@uukelele-scratch
Copy link
Contributor

seems to include #659 inside here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants