Repository navigation
Conversation
Shift-scroll, the spellbook keybinds, and the casting grid only matched the vanilla spellbook, so addons that extend ItemSpellbook could not change pages.
The spellbook and the abacus are both in the tag. Other items opt in through the tag instead of subclassing ItemSpellbook.
Member
|
Closed in favor of #1329, which provides an alternate fix for the problem described here. |
hexxy-weblate
pushed a commit
to hexxy-weblate/HexMod
that referenced
this pull request
Oct 13, 2026
A slightly more robust solution to the problem described in FallingColors#1328, namely that the shift-scrolling mechanics currently do not work on anything other than spellbooks even if the item in question provides all the right NBT (or even if it directly extends ItemSpellbook). FallingColors#1328 resolved the problem by adding a new item tag - here, I've simply changed the code that previously checked "is this item a spellbook" to instead check "does this item have the `page_idx` and `page_names` NBT tags". This means you can simply apply those NBT tags to any item to allow shift-scrolling it. This is also in line with the general idea of 1.21's item components, where simply attaching the component to an item is enough to apply the relevant functionality to that item, without having to manually implement it. <img width="460" height="200" alt="2026-10-11_15 48 50" src="https://github.com/user-attachments/assets/fecec52e-2677-436b-84ad-37d1f4495d42" />
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request is for Almightly Staff. That mod's staff stores pages the same way a spellbook does, but it is not
HexItems.SPELLBOOK. Shift-scroll, the spellbook keybinds, and the scroll wheel inside the casting grid ignore it, because those paths compare the item by identity. Hex Spell Wheel can list the staff's pages and then sendsMsgShiftScrollC2S; the server drops that packet, so selecting a page does nothing. Reported in Almightly Staff #1.Rather than keep a second scroll listener inside Almightly Staff, this lets any such item opt into the existing Hex path.
The new item tag is
hexcasting:shift_scrollable. The spellbook and the abacus are both in it by default, so their current behavior is unchanged. Almightly Staff adds its staff to the tag from its own datapack. Other mods can do the same.HexItems.ABACUSwith the abacus logic. Any other stack in the tag uses the spellbook page logic (ItemSpellbook.rotatePageIdx).Test plan
由于笔者英文水平不足,本文由grok4.7生成,我很抱歉。
The author's English is limited, so this text was generated by Grok 4.7. Apologies.