Skip to content

Conversation

@eclipseisoffline
Copy link
Member

@eclipseisoffline eclipseisoffline commented Jul 16, 2025

This PR intends to fully implement Java tooltip partity, or as much as that is possible.

This PR fixes or will fix the following issues:

  • Tooltips for the minecraft:tropical_fish_pattern component only show up on tropical fish buckets.
  • Tooltips for the minecraft:instrument component only show up on goat horns.
  • Bedrock clients are unable to see the amount of bees contained in a bee nest or beehive (new Java parity).
  • Bedrock clients are unable to see if a container has custom loot in it (new Java parity).
  • Bedrock clients are unable to see items stored in a container other than shulker boxes.
  • Bedrock clients are unable to see tooltips for custom banner patterns.
  • Bedrock clients are unable to see tooltips for custom music discs.
  • Bedrock clients are unable to see the colour of a dyed item in HEX notation when advanced tooltips are enabled (new Java parity).
  • Bedrock clients are unable to see the effects of suspicious stew when in creative mode (new Java parity).
  • Bedrock clients are unable to see the amount of honey contained in a bee nest or beehive (new Java parity).
  • Bedrock clients are unable to see the "can place on" and "can break" tooltips of the minecraft:can_place_on and minecraft:can_break components (new Java parity).
  • Advanced tooltips created by Geyser always use the default max damage value of an item.
  • Bedrock clients are unable to see the "dangerous NBT" warning added in Java 1.21.4 (new Java parity).

... among other issues as well. This PR also adds new functionality to MinecraftLocale, to load the deprecated.json language file (introduced in Java 1.21.2), which contains removed and replaced language keys, and applies it to loaded locales. This ensures the proper translation keys are resolved.

Along with these changes, this PR also refactors the loading of data-driven registries. JavaRegistryKeys now support parsing and translating MCPL's Holders to objects loaded by Geyser, when possible. Some refactors to loaded registry objects, such as JukeboxSong and GeyserInstrument have also been made, to accommodate for the new way of building tooltips.

Of course, this PR also overhauls the building of tooltips in the ItemTranslator class, and spreads this over multiple classes to increase code readability.

This PR is still unfinished and there are some things left to do. Here are some things worth noting:

  • Re-translating tooltip text components every time an item is translated could have a performance impact.
  • Some tooltips now occur twice because both bedrock and Geyser add them.
  • Item stack name computation is not correct (should be moved from Anvil updater refactor and other small refactors #5595 to here).
  • Some tooltips are still left to do (e.g. spawner tooltip, map tooltip, trim tooltip, potion tooltip in item name, other specific item tooltips).

Here are some images to illustrate a couple of the new tooltip changes (left Java, right bedrock. Apologies for the difference in screenshot size):

bees_java bees_bedrock container_java container_bedrock container_loot_java container_loot_bedrock instrument_java instrument_bedrock op_java op_bedrock

Copy link
Member

@onebeastchris onebeastchris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is another insane PR, the 3rd or 4th registry refactor? xd

I'm sceptical about how useful it is to have occasionally duplicate/conflicting tooltips. Might be worth exploring whether we can use the optional pack to yeet them entirely?

Also, performance of this could be... interesting. Same as maintainability; but with components being now as far as they are I'd assume this wouldn't change too much

Haven't done a proper review yet, mainly because I'd like to test it to see how much this would actually be "confusing"; and to see if there's possibilities to cook with the optional pack!

Comment on lines +137 to +140
// TODO tooltips for default components?
public static void addNameTooltips(TooltipContext context, DataComponents componentPatch, Consumer<String> adder) {
// TODO
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these (more or less) already being added by the Bedrock client?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all of them - see e.g. #5555 and #5176.

return is(tag, itemStack.asItem());
}


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@onebeastchris onebeastchris added Work in Progress The issue is currently being worked on. PR: Feature When a PR implements a new feature PR: Bugfix When a PR contains a bugfix PR: Cosmetic When a PR adds something that is purely cosmetic, like changing the README labels Aug 9, 2025
@onebeastchris onebeastchris linked an issue Sep 18, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Bugfix When a PR contains a bugfix PR: Cosmetic When a PR adds something that is purely cosmetic, like changing the README PR: Feature When a PR implements a new feature Work in Progress The issue is currently being worked on.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Tools with attributes not working on bedrock

2 participants