Skip to content

fix(Quiver): read potion contents from ItemStack and fix inventory scan and head check - #6714

Merged
MineGame159 merged 2 commits into
MeteorDevelopment:masterfrom
Eccys:fix/quiver-tipped-arrows
Oct 17, 2026
Merged

MineGame159 merged 2 commits into
MeteorDevelopment:masterfrom
Eccys:fix/quiver-tipped-arrows

Conversation

@Eccys

@Eccys Eccys commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • New feature

Description

  • Read DataComponents.POTION_CONTENTS from the ItemStack (item.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY)) instead of item.getItem().components(), which reads the base Items.TIPPED_ARROW default components (PotionContents.EMPTY) and never matches any tipped arrows.
  • Iterate from SlotUtils.OFFHAND down to SlotUtils.HOTBAR_START while skipping armor slots (SlotUtils.isArmor(i)), instead of starting at mc.player.getInventory().getContainerSize() (which included armor slots and out-of-bounds index 41 and skipped slot 0), and skip moving slot 9 to slot 9 when the arrow is already in slot 9.
  • Use testPos.setWithOffset(...) / testPos.move(0, 1, 0) instead of discarding the return value of immutable BlockPos.offset(...) and BlockPos.relative(...) calls on MutableBlockPos in headIsOpen() and isSurrounded().
  • Initialize wasMainhand, wasHotbar, and prevSlot before shouldQuiver() can early-deactivate the module, and release keyUse in onDeactivate().

Related issues

Closes #6343

How Has This Been Tested?

Compiled with ./gradlew compileJava and verified slot bounds, DataComponents.POTION_CONTENTS lookup, and MutableBlockPos mutations in headIsOpen() and isSurrounded().

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@MineGame159
MineGame159 merged commit fcea327 into MeteorDevelopment:master Oct 17, 2026
1 check passed
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.

Quiver fails to find tipped arrows, even if they are present

2 participants