Skip to content

Hide additional item tooltips (banner patterns, potion effects, etc.) in all panels using modern TooltipDisplay API#2924

Merged
tastybento merged 4 commits intodevelopfrom
copilot/add-option-to-disable-attributes
Apr 8, 2026
Merged

Hide additional item tooltips (banner patterns, potion effects, etc.) in all panels using modern TooltipDisplay API#2924
tastybento merged 4 commits intodevelopfrom
copilot/add-option-to-disable-attributes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Panel items with rich metadata (banners, potions, spawners, bundles) leaked per-item tooltip lines into menu lore, cluttering the display and making intended text harder to read.

Changes

  • PanelItem.java — Replaced the deprecated ItemFlag.HIDE_ADDITIONAL_TOOLTIP with Paper's modern TooltipDisplay data component API. A new hideAdditionalTooltip() helper method uses TooltipDisplay.tooltipDisplay().addHiddenComponents() to hide item-specific tooltip information (banner patterns, potion effects, firework effects, jukebox playable, suspicious stew effects, bundle contents, and map decorations). The method merges with any existing tooltip display set by the non-deprecated ItemFlags (HIDE_ATTRIBUTES, HIDE_DESTROYS, HIDE_PLACED_ON, HIDE_ENCHANTS) to avoid overwriting them. Called at the end of both the constructor and setHead().

  • PanelItemTest.java — Updated testSetHead to verify the TooltipDisplay data component is applied via setData() instead of the deprecated HIDE_ADDITIONAL_TOOLTIP flag.

Since all GUI panels go through PanelItem, this fix covers every menu in BentoBox (language selector, settings, admin panels, etc.) without any per-panel changes.

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
2 tasks
…erns, potion effects, etc.

Agent-Logs-Url: https://github.com/BentoBoxWorld/BentoBox/sessions/5e0b4734-f396-4418-9b39-4f67a244dd21

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to disable attributes in menus Hide additional item tooltips (banner patterns, potion effects, etc.) in all panels Apr 7, 2026
Copilot AI requested a review from tastybento April 7, 2026 17:18
@tastybento tastybento marked this pull request as ready for review April 7, 2026 17:21
@tastybento
Copy link
Copy Markdown
Member

@copilot ItemFlag.HIDE_ADDITIONAL_TOOLTIP is Deprecated and the notes say:
does not exist anymore and will not properly work with individually hidden data components; see io.papermc.paper.datacomponent.item.TooltipDisplay and ItemStack.setData(DataComponentType.Valued, Object)

Is there an alternative approach that isn't deprecated?

… data component API

Agent-Logs-Url: https://github.com/BentoBoxWorld/BentoBox/sessions/d1d186bf-e269-47b1-bebc-d16b151d1ffc

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot ItemFlag.HIDE_ADDITIONAL_TOOLTIP is Deprecated and the notes say:
does not exist anymore and will not properly work with individually hidden data components; see io.papermc.p...

Replaced with Paper's modern TooltipDisplay data component API in 7c0e6a9. The new hideAdditionalTooltip() method uses TooltipDisplay.tooltipDisplay().addHiddenComponents() to hide banner patterns, potion effects, firework effects, jukebox playable info, suspicious stew effects, bundle contents, and map decorations. It also merges with any existing tooltip display set by the non-deprecated ItemFlags (HIDE_ATTRIBUTES, etc.) to avoid overwriting them.

Copilot AI changed the title Hide additional item tooltips (banner patterns, potion effects, etc.) in all panels Hide additional item tooltips (banner patterns, potion effects, etc.) in all panels using modern TooltipDisplay API Apr 8, 2026
@tastybento tastybento merged commit cad30ec into develop Apr 8, 2026
1 check passed
@tastybento tastybento deleted the copilot/add-option-to-disable-attributes branch April 8, 2026 02:04
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

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.

Hiding attributes in the menu

2 participants